{"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Display all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Group catalog by image_url and show the sum of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, SUM(updated_at) AS sum_updated_at FROM logistics.catalog GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "List city, coordinates, location_lat from branches.", "sql": null}, {"role": "assistant", "content": "SELECT city, coordinates, location_lat FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Get parking_available, accessibility, attachment_url, parent_id by joining branches with messages.", "sql": null}, {"role": "assistant", "content": "SELECT city, coordinates, location_lat, messages.attachment_url, messages.parent_id FROM logistics.branches JOIN logistics.messages ON branches.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "What is the count location_lat for each coordinates in branches?", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, COUNT(location_lat) AS count_location_lat FROM logistics.branches GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Find branches older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reply_to_id, likes, media_url for every message.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, likes, media_url FROM logistics.messages;", "sql": null}, {"role": "user", "content": "Find messages created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, likes, media_url FROM logistics.messages WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with attachment_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, likes, media_url FROM logistics.messages WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY attachment_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by location_lat ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches ORDER BY location_lat ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Show me parent_id, attachment_url, thumbnail for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, attachment_url, thumbnail FROM logistics.messages;", "sql": null}, {"role": "user", "content": "Get media_url, thumbnail, coordinates, location_lat by joining messages with branches.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, attachment_url, thumbnail, branches.coordinates, branches.location_lat FROM logistics.messages JOIN logistics.branches ON messages.branche_id = branches.store_id;", "sql": null}, {"role": "user", "content": "Get max of branche_id by attachment_url from messages.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, MAX(branche_id) AS max_branche_id FROM logistics.messages GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, image_url, branche_id for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, image_url, branche_id FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Get catalog that match branche_id > 73.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, image_url, branche_id FROM logistics.catalog WHERE branche_id > 73;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, image_url, branche_id FROM logistics.catalog WHERE branche_id > 73 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "List branche_id, backorder, featured_rank from catalog.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, backorder, featured_rank FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Retrieve branche_id, backorder, last_inspected, location_lat showing the relationship between catalog and branches.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, backorder, featured_rank, branches.last_inspected, branches.location_lat FROM logistics.catalog JOIN logistics.branches ON catalog.branche_id = branches.store_id;", "sql": null}, {"role": "user", "content": "Tally up catalog by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM logistics.catalog GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.messages;", "sql": null}, {"role": "user", "content": "Find messages between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.messages WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up messages by reply_to_id.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, COUNT(*) AS count FROM logistics.messages GROUP BY reply_to_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.catalog (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n backorder varchar,\n image_url character varying(256),\n branche_id integer NOT NULL -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)\n\nCREATE TABLE logistics.branches (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n parking_available char,\n accessibility text,\n location_lat varchar,\n longitude char,\n coordinates character varying(256),\n city character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE logistics.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n likes character varying(128),\n thumbnail character varying(256) NOT NULL,\n attachment_url character varying(128),\n parent_id character varying(128),\n media_url character varying(64),\n reply_to_id character varying(64),\n branche_id integer -- reference to branches.store_id,\n FOREIGN KEY (branche_id) REFERENCES branches(store_id)\n)", "conversations": [{"role": "user", "content": "List all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "What parking_available, coordinates, branche_id, likes do we have for branches and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.branche_id, messages.likes FROM logistics.branches JOIN logistics.messages ON branches.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Get average of city by city from branches.", "sql": null}, {"role": "assistant", "content": "SELECT city, AVERAGE(city) AS average_city FROM logistics.branches GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get updated_at, rating, rating, manufacturer by joining appointments with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.rating, doctors.manufacturer FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.barcode;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.rating, doctors.manufacturer FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.barcode LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "List rating, user_id, updated_at from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, updated_at FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve doctor_id, shares, featured_rank, appointment_id showing the relationship between appointments and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, updated_at, doctors.featured_rank, doctors.appointment_id FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.barcode;", "sql": null}, {"role": "user", "content": "Calculate count of rating for each rating in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(rating) AS count_rating FROM healthcare.appointments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "List location_lat, created_at, doctor_id from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, created_at, doctor_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, created_at, doctor_id FROM healthcare.medical_records WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by city descending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, created_at, doctor_id FROM healthcare.medical_records WHERE created_at > '2023-01-01' ORDER BY city DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Order the output by featured_rank ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY featured_rank ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY featured_rank ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Group appointments by doctor_id and show the min of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, MIN(updated_at) AS min_updated_at FROM healthcare.appointments GROUP BY doctor_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show the results sorted by manufacturer ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY manufacturer ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve appointment_id, featured_rank, user_id, author_id showing the relationship between doctors and appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.user_id, appointments.author_id FROM healthcare.doctors JOIN healthcare.appointments ON doctors.appointment_id = appointments.comment_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.user_id, appointments.author_id FROM healthcare.doctors JOIN healthcare.appointments ON doctors.appointment_id = appointments.comment_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n manufacturer character varying(256),\n featured_rank varchar,\n rating varchar,\n appointment_id integer NOT NULL -- reference to appointments.comment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n shares varchar,\n author_id character varying(128),\n rating character varying(256),\n user_id character varying(128),\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n city character varying(256) NOT NULL,\n location_lat varchar,\n parking_available text NOT NULL,\n doctor_id text -- reference to doctors.barcode,\n FOREIGN KEY (doctor_id) REFERENCES doctors(barcode)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n vendor_id char,\n user_id text,\n approval_status character varying(64),\n credit text,\n reference_number varchar\n)", "conversations": [{"role": "user", "content": "Get featured_rank, rating, appointment_id from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, rating, appointment_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, rating, appointment_id FROM healthcare.doctors ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by manufacturer descending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, rating, appointment_id FROM healthcare.doctors ORDER BY manufacturer DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the created_at, product_id, description of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, product_id, description FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, product_id, description FROM e-commerce.shipping WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many shipping are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, description, product_id for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, description, product_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where order_item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, description, product_id FROM e-commerce.shipping WHERE order_item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, description, product_id FROM e-commerce.shipping WHERE order_item_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "List created_at, available, product_id from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, available, product_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, available, product_id FROM e-commerce.shipping WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by order_item_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, available, product_id FROM e-commerce.shipping WHERE description LIKE 'A%' ORDER BY order_item_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of description grouped by available for shipping.", "sql": null}, {"role": "assistant", "content": "SELECT available, MAX(description) AS max_description FROM e-commerce.shipping GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the order_item_id, created_at, product_id of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, created_at, product_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, created_at, product_id FROM e-commerce.shipping WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, created_at, product_id FROM e-commerce.shipping WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY stock_level ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me product_id, order_item_id, available for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, order_item_id, available FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, order_item_id, available FROM e-commerce.shipping WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, order_item_id, available FROM e-commerce.shipping WHERE stock_level LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group shipping by order_item_id and show the max of order_item_id.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, MAX(order_item_id) AS max_order_item_id FROM e-commerce.shipping GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of shipping across different order_item_id values.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, COUNT(*) AS count FROM e-commerce.shipping GROUP BY order_item_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n available char,\n description character varying(256) NOT NULL,\n stock_level character varying(128),\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login timestamp without time zone NOT NULL,\n first_name character varying(64),\n status char\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n display_name character varying(64),\n api_key character varying(64) NOT NULL,\n website character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve available, description, first_name, created_at showing the relationship between shipping and order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.first_name, order_items.created_at FROM e-commerce.shipping JOIN e-commerce.order_items ON shipping.order_item_id = order_items.id;", "sql": null}, {"role": "user", "content": "Count the number of shipping in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments with website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of departments in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.departments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve student_id, sku, media_url for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, sku, media_url FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, sku, media_url FROM education.assignments WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by sku ascending.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, sku, media_url FROM education.assignments WHERE thumbnail_url LIKE 'A%' ORDER BY sku ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get all teachers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of teachers grouped by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM education.teachers GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me created_at, display_name, last_name for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, display_name, last_name FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, display_name, last_name FROM education.departments WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by display_name.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.departments GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me full_name, last_name, website for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_name, website FROM education.departments;", "sql": null}, {"role": "user", "content": "Sort the results by last_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_name, website FROM education.departments ORDER BY last_name DESC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_name, website FROM education.departments ORDER BY last_name DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with cost > 98.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE cost > 98;", "sql": null}, {"role": "user", "content": "Count the number of assignments in each sku category.", "sql": null}, {"role": "assistant", "content": "SELECT sku, COUNT(*) AS count FROM education.assignments GROUP BY sku ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n cost decimal,\n media_url char NOT NULL,\n thumbnail_url character varying(128),\n category char NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.teachers (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total numeric,\n card_type character varying(256),\n exchange_rate char NOT NULL,\n payment_status character varying(64),\n tax integer,\n student_id integer NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.departments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n display_name character varying(256),\n last_name character varying(128),\n full_name character varying(64),\n website character varying(256),\n first_name character varying(64),\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n country varchar,\n last_name text,\n city text,\n zip_code character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of teachers across different processed_at values.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM education.teachers GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n password_hash varchar,\n token character varying(64),\n is_active bit,\n email character varying(128) NOT NULL,\n status character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp,\n name char NOT NULL,\n geo_point character varying(128),\n latitude varchar NOT NULL,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)\n\nCREATE TABLE healthcare.appointments (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n backorder char,\n subcategory varchar,\n reserved character varying(128),\n image_url character varying(256) NOT NULL,\n msrp text NOT NULL,\n available character varying(64),\n department_id integer NOT NULL -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(256),\n message char,\n views char,\n author_id character varying(256),\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n password_hash varchar,\n token character varying(64),\n is_active bit,\n email character varying(128) NOT NULL,\n status character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp,\n name char NOT NULL,\n geo_point character varying(128),\n latitude varchar NOT NULL,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)\n\nCREATE TABLE healthcare.appointments (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n backorder char,\n subcategory varchar,\n reserved character varying(128),\n image_url character varying(256) NOT NULL,\n msrp text NOT NULL,\n available character varying(64),\n department_id integer NOT NULL -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(256),\n message char,\n views char,\n author_id character varying(256),\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get departments that match views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count score for each author_id in departments?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(score) AS count_score FROM healthcare.departments GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n password_hash varchar,\n token character varying(64),\n is_active bit,\n email character varying(128) NOT NULL,\n status character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp,\n name char NOT NULL,\n geo_point character varying(128),\n latitude varchar NOT NULL,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)\n\nCREATE TABLE healthcare.appointments (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n backorder char,\n subcategory varchar,\n reserved character varying(128),\n image_url character varying(256) NOT NULL,\n msrp text NOT NULL,\n available character varying(64),\n department_id integer NOT NULL -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(256),\n message char,\n views char,\n author_id character varying(256),\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Sort the results by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY available DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY available DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by categories descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY categories DESC;", "sql": null}, {"role": "user", "content": "Order the output by categories descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY categories DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of payments in each account_id category.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.payments GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Get user_id, audit_id, account_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, audit_id, account_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, audit_id, account_id FROM finance.payments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different discount values.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM finance.payments GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Arrange the results with discount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY discount DESC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY discount DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "What discount, user_id, due_date, notes do we have for payments and their associated accounts?", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.due_date, accounts.notes FROM finance.payments JOIN finance.accounts ON payments.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Show me count of transaction_id grouped by subtotal for payments.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(transaction_id) AS count_transaction_id FROM finance.payments GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with reply_to_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY reply_to_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "What are the subtotal, user_id, discount of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, user_id, discount FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by audit_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, user_id, discount FROM finance.payments ORDER BY audit_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, user_id, discount FROM finance.payments ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n likes character varying(128),\n categories text NOT NULL,\n reply_to_id char -- identifier for reply_to,\n account_id integer -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n created_at timestamp without time zone,\n approval_status char NOT NULL,\n customer_id char NOT NULL -- identifier for customer,\n notes varchar,\n exchange_rate text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n user_id text -- identifier for user,\n discount integer,\n subtotal numeric,\n account_id integer -- reference to accounts.id,\n audit_id integer NOT NULL -- reference to audits.post_id,\n FOREIGN KEY (account_id) REFERENCES accounts(id),\n FOREIGN KEY (audit_id) REFERENCES audits(post_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n token char NOT NULL,\n language varchar,\n email char,\n timezone text NOT NULL,\n state character varying(256),\n account_status text\n)", "conversations": [{"role": "user", "content": "Get subtotal, audit_id, updated_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, audit_id, updated_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, audit_id, updated_at FROM finance.payments ORDER BY discount ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different transaction_id values.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM finance.payments GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get popularity_score, expires_at, created_at from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, created_at FROM finance.investments;", "sql": null}, {"role": "user", "content": "Sort the results by loan_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, created_at FROM finance.investments ORDER BY loan_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, created_at FROM finance.investments ORDER BY loan_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "List name, rating, created_at from investments.", "sql": null}, {"role": "assistant", "content": "SELECT name, rating, created_at FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT name, rating, created_at FROM finance.investments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by loan_id.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, COUNT(*) AS count FROM finance.investments GROUP BY loan_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve investment_id, created_at, customer_id for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, created_at, customer_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits with investment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, created_at, customer_id FROM finance.audits WHERE investment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, created_at, customer_id FROM finance.audits WHERE investment_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many audits are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.audits GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "List user_id, created_at, customer_id from audits.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, created_at, customer_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, created_at, customer_id FROM finance.audits WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "How many audits are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.audits GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, investment_id, created_at for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, investment_id, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, investment_id, created_at FROM finance.audits WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of audits grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.audits GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get expires_at, created_at, loan_id from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, created_at, loan_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, created_at, loan_id FROM finance.investments ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Calculate max of name for each rating in investments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, MAX(name) AS max_name FROM finance.investments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "What created_at, customer_id, name, popularity_score do we have for audits and their associated investments?", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.name, investments.popularity_score FROM finance.audits JOIN finance.investments ON audits.investment_id = investments.product_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.name, investments.popularity_score FROM finance.audits JOIN finance.investments ON audits.investment_id = investments.product_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve loan_id, rating, amount, subtotal showing the relationship between investments and loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.amount, loans.subtotal FROM finance.investments JOIN finance.loans ON investments.loan_id = loans.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.amount, loans.subtotal FROM finance.investments JOIN finance.loans ON investments.loan_id = loans.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id character varying(128) -- identifier for user,\n customer_id varchar,\n investment_id text -- reference to investments.product_id,\n FOREIGN KEY (investment_id) REFERENCES investments(product_id)\n)\n\nCREATE TABLE finance.loans (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n payment_status character varying(128),\n status char,\n amount numeric(38,14),\n price numeric,\n customer_id character varying(256),\n subtotal numeric\n)\n\nCREATE TABLE finance.investments (\n product_id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n popularity_score character varying(128),\n rating varchar,\n price numeric(38,14),\n name char,\n loan_id integer NOT NULL -- reference to loans.transaction_id,\n FOREIGN KEY (loan_id) REFERENCES loans(transaction_id)\n)", "conversations": [{"role": "user", "content": "List customer_id, created_at, investment_id from audits.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, investment_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, investment_id FROM finance.audits ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, investment_id FROM finance.audits ORDER BY user_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me description, thumbnail_url, image_url for all items.", "sql": null}, {"role": "assistant", "content": "SELECT description, thumbnail_url, image_url FROM retail.items;", "sql": null}, {"role": "user", "content": "Find items from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT description, thumbnail_url, image_url FROM retail.items WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT description, thumbnail_url, image_url FROM retail.items WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the cost, currency, name of each item?", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, name FROM retail.items;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, name FROM retail.items ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by featured_rank ascending?", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, name FROM retail.items ORDER BY featured_rank ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me name, addresse_id, item_id for all items.", "sql": null}, {"role": "assistant", "content": "SELECT name, addresse_id, item_id FROM retail.items;", "sql": null}, {"role": "user", "content": "List items that have image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, addresse_id, item_id FROM retail.items WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of items grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM retail.items GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items;", "sql": null}, {"role": "user", "content": "Can you order these by image_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Show me average of addresse_id grouped by description for items.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(addresse_id) AS average_addresse_id FROM retail.items GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items;", "sql": null}, {"role": "user", "content": "Arrange the results with currency in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items ORDER BY currency ASC;", "sql": null}, {"role": "user", "content": "Get max of thumbnail_url by published_at from items.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, MAX(thumbnail_url) AS max_thumbnail_url FROM retail.items GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me name, published_at, created_at for all items.", "sql": null}, {"role": "assistant", "content": "SELECT name, published_at, created_at FROM retail.items;", "sql": null}, {"role": "user", "content": "Retrieve items where description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, published_at, created_at FROM retail.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group items by item_id and show the min of cost.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, MIN(cost) AS min_cost FROM retail.items GROUP BY item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items;", "sql": null}, {"role": "user", "content": "List items that have thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of name for each description in items.", "sql": null}, {"role": "assistant", "content": "SELECT description, MIN(name) AS min_name FROM retail.items GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items;", "sql": null}, {"role": "user", "content": "Retrieve items where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many items are there per thumbnail_url?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM retail.items GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "List cost, currency, created_at from items.", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, created_at FROM retail.items;", "sql": null}, {"role": "user", "content": "List featured_rank, name, coordinates, parking_available for each item along with their addresse information.", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, created_at, addresses.coordinates, addresses.parking_available FROM retail.items JOIN retail.addresses ON items.addresse_id = addresses.venue_id;", "sql": null}, {"role": "user", "content": "Tally up items by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM retail.items GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at date,\n category varchar NOT NULL,\n type character varying(128),\n parking_available character varying(64),\n accessibility text,\n coordinates text\n)\n\nCREATE TABLE retail.items (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n created_at timestamp without time zone,\n name text,\n cost numeric,\n thumbnail_url char NOT NULL,\n image_url char,\n featured_rank char NOT NULL,\n currency varchar,\n description character varying(256),\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items;", "sql": null}, {"role": "user", "content": "Can you order these by addresse_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.items ORDER BY addresse_id ASC;", "sql": null}, {"role": "user", "content": "How many items are there per cost?", "sql": null}, {"role": "assistant", "content": "SELECT cost, COUNT(*) AS count FROM retail.items GROUP BY cost ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me rating, views, bio, last_active from courses and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.bio, students.last_active FROM education.courses JOIN education.students ON courses.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of courses across different popularity_score values.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(*) AS count FROM education.courses GROUP BY popularity_score ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Tally up courses by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM education.courses GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Show me rating, image_url, created_at for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT rating, image_url, created_at FROM education.courses;", "sql": null}, {"role": "user", "content": "Get manufacturer, name, joined_at, bio by joining courses with students.", "sql": null}, {"role": "assistant", "content": "SELECT rating, image_url, created_at, students.joined_at, students.bio FROM education.courses JOIN education.students ON courses.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Calculate max of manufacturer for each rating in courses.", "sql": null}, {"role": "assistant", "content": "SELECT rating, MAX(manufacturer) AS max_manufacturer FROM education.courses GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Show me published_at, created_at, image_url for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, image_url FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, image_url FROM education.courses ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "What is the max rating for each rating in courses?", "sql": null}, {"role": "assistant", "content": "SELECT rating, MAX(rating) AS max_rating FROM education.courses GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with manufacturer in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY manufacturer ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Arrange the results with student_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY student_id DESC;", "sql": null}, {"role": "user", "content": "Calculate min of manufacturer for each created_at in courses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(manufacturer) AS min_manufacturer FROM education.courses GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Show me popularity_score, brand, image_url for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, brand, image_url FROM education.courses;", "sql": null}, {"role": "user", "content": "What rating, image_url, birth_date, bio do we have for courses and their associated students?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, brand, image_url, students.birth_date, students.bio FROM education.courses JOIN education.students ON courses.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Group courses by image_url and show the sum of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, SUM(published_at) AS sum_published_at FROM education.courses GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "List manufacturer, name, popularity_score from courses.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, name, popularity_score FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, name, popularity_score FROM education.courses WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, name, popularity_score FROM education.courses WHERE manufacturer LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "What are the manufacturer, published_at, name of each course?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, published_at, name FROM education.courses;", "sql": null}, {"role": "user", "content": "Retrieve courses where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, published_at, name FROM education.courses WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, published_at, name FROM education.courses WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128) NOT NULL,\n brand char NOT NULL,\n manufacturer character varying(64),\n rating text,\n views character varying(256),\n name text,\n popularity_score varchar,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp without time zone,\n password_hash text,\n birth_date date,\n gender varchar,\n bio char\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Sort the results by manufacturer ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY manufacturer ASC;", "sql": null}, {"role": "user", "content": "Get count of manufacturer by popularity_score from courses.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(manufacturer) AS count_manufacturer FROM education.courses GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "What are the popularity_score, expires_at, currency of each product?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, currency FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by review_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, currency FROM e-commerce.products ORDER BY review_id ASC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, expires_at, currency FROM e-commerce.products ORDER BY review_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Get content, thumbnail, keywords from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, keywords FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews from last week.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, keywords FROM e-commerce.reviews WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with shippin_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, keywords FROM e-commerce.reviews WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY shippin_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, currency, stock_level for every product.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, currency, stock_level FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, currency, stock_level FROM e-commerce.products ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "What is the count expires_at for each review_id in products?", "sql": null}, {"role": "assistant", "content": "SELECT review_id, COUNT(expires_at) AS count_expires_at FROM e-commerce.products GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "List keywords, thumbnail, content from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, thumbnail, content FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where thumbnail LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, thumbnail, content FROM e-commerce.reviews WHERE thumbnail LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of reviews in each thumbnail category.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, COUNT(*) AS count FROM e-commerce.reviews GROUP BY thumbnail ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group products by expires_at and show the count of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(updated_at) AS count_updated_at FROM e-commerce.products GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "What thumbnail, shippin_id, address_line2, longitude do we have for reviews and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.address_line2, shipping.longitude FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.store_id;", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.reviews GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.reviews GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject character varying(64) NOT NULL,\n keywords character varying(256) NOT NULL,\n content text NOT NULL,\n thumbnail character varying(64),\n shippin_id text -- reference to shipping.store_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(store_id)\n)\n\nCREATE TABLE e-commerce.products (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n popularity_score char,\n stock_level text NOT NULL,\n currency varchar,\n thumbnail_url varchar,\n review_id text NOT NULL -- reference to reviews.content_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n timezone text,\n longitude character varying(128),\n name character varying(64) NOT NULL,\n address_line2 text\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Sort the results by shippin_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY shippin_id ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY shippin_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me image_url, views, stock_level for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, views, stock_level FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications that have image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, views, stock_level FROM tradingplatform.notifications WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with views in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, views, stock_level FROM tradingplatform.notifications WHERE image_url LIKE 'A%' ORDER BY views ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List popularity_score, video_url, metadat_id from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, video_url, metadat_id FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get notifications that match stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, video_url, metadat_id FROM tradingplatform.notifications WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by tax_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, video_url, metadat_id FROM tradingplatform.notifications WHERE stock_level LIKE 'A%' ORDER BY tax_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List backorder, created_at, notification_id from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, notification_id FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, notification_id FROM tradingplatform.metadata WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of metadata in each featured_rank category.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List popularity_score, metadat_id, views from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, metadat_id, views FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve published_at, image_url, backorder, video_url showing the relationship between notifications and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, metadat_id, views, metadata.backorder, metadata.video_url FROM tradingplatform.notifications JOIN tradingplatform.metadata ON notifications.metadat_id = metadata.sku;", "sql": null}, {"role": "user", "content": "Show the results sorted by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, metadat_id, views, metadata.backorder, metadata.video_url FROM tradingplatform.notifications JOIN tradingplatform.metadata ON notifications.metadat_id = metadata.sku ORDER BY stock_level ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me notification_id, featured_rank, backorder for all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, featured_rank, backorder FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, featured_rank, backorder FROM tradingplatform.metadata ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by backorder ascending.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, featured_rank, backorder FROM tradingplatform.metadata ORDER BY backorder ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by video_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE created_at > '2023-01-01' ORDER BY video_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by tax_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY tax_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Arrange the results with popularity_score in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "What is the sum views for each views in notifications?", "sql": null}, {"role": "assistant", "content": "SELECT views, SUM(views) AS sum_views FROM tradingplatform.notifications GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n discount decimal,\n backorder character varying(256),\n video_url varchar -- identifier for video_url,\n featured_rank char NOT NULL,\n notification_id text NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n video_url character varying(256) NOT NULL -- identifier for video_url,\n tax_rate character varying(64) NOT NULL,\n stock_level character varying(256),\n views character varying(64),\n popularity_score character varying(256),\n image_url character varying(256),\n metadat_id integer NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group metadata by video_url and show the count of notification_id.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, COUNT(notification_id) AS count_notification_id FROM tradingplatform.metadata GROUP BY video_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get full_name, address, doctor_id from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, address, doctor_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, address, doctor_id FROM healthcare.departments WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group departments by full_name and show the average of doctor_id.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, AVERAGE(doctor_id) AS average_doctor_id FROM healthcare.departments GROUP BY full_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me address, api_key, subtotal, completed_at from departments and their related doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.subtotal, doctors.completed_at FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different doctor_id values.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.departments GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "What are the joined_at, full_name, birth_date of each department?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, full_name, birth_date FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, full_name, birth_date FROM healthcare.departments WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many departments are there per address?", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM healthcare.departments GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List birth_date, created_at, product_id, exchange_rate for each department along with their doctor information.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.product_id, doctors.exchange_rate FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.product_id, doctors.exchange_rate FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, created_at, birth_date for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, birth_date FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me created_at, language, exchange_rate, subtotal from departments and their related doctors.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, birth_date, doctors.exchange_rate, doctors.subtotal FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "Order the output by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, birth_date, doctors.exchange_rate, doctors.subtotal FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id ORDER BY account_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me average of full_name grouped by account_status for departments.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, AVERAGE(full_name) AS average_full_name FROM healthcare.departments GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, language, full_name of each department?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, language, full_name FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get birth_date, customer_id, status, product_id by joining departments with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, language, full_name, doctors.status, doctors.product_id FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "How many departments are there per api_key?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM healthcare.departments GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get doctor_id, account_status, customer_id from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, account_status, customer_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List language, address, exchange_rate, completed_at for each department along with their doctor information.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, account_status, customer_id, doctors.exchange_rate, doctors.completed_at FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "How many departments are there per joined_at?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.departments GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, language, address of each department?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, language, address FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by address descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, language, address FROM healthcare.departments ORDER BY address DESC;", "sql": null}, {"role": "user", "content": "Get min of account_status by customer_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MIN(account_status) AS min_account_status FROM healthcare.departments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n subtotal numeric NOT NULL,\n buyer_id char,\n product_id character varying(64) NOT NULL,\n amount bigint NOT NULL,\n status text NOT NULL,\n exchange_rate varchar\n)\n\nCREATE TABLE healthcare.departments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at timestamp,\n address text NOT NULL,\n birth_date timestamp,\n api_key character varying(128),\n language text,\n account_status char NOT NULL,\n full_name varchar,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the keywords, text, created_at of each article?", "sql": null}, {"role": "assistant", "content": "SELECT keywords, text, created_at FROM manufacturing.articles;", "sql": null}, {"role": "user", "content": "List articles with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, text, created_at FROM manufacturing.articles WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, text, created_at FROM manufacturing.articles WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Get payment_date, credit, invoice_number from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, credit, invoice_number FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Get billing that match payee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, credit, invoice_number FROM manufacturing.billing WHERE payee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of payee_id by invoice_number from billing.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, MIN(payee_id) AS min_payee_id FROM manufacturing.billing GROUP BY invoice_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve payee_id, credit, processed_at for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, credit, processed_at FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, credit, processed_at FROM manufacturing.billing WHERE payment_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, credit, processed_at FROM manufacturing.billing WHERE payment_date BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Sort the results by payment_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.billing ORDER BY payment_date ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_date in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.billing ORDER BY payment_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve payee_id, processed_at, payment_date for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, processed_at, payment_date FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Can you order these by payee_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, processed_at, payment_date FROM manufacturing.billing ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "Get max of payment_date by processed_at from billing.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MAX(payment_date) AS max_payment_date FROM manufacturing.billing GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.articles;", "sql": null}, {"role": "user", "content": "Show me articles with likes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.articles WHERE likes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.articles WHERE likes LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me text, edited_at, created_at for all articles.", "sql": null}, {"role": "assistant", "content": "SELECT text, edited_at, created_at FROM manufacturing.articles;", "sql": null}, {"role": "user", "content": "Show me articles that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT text, edited_at, created_at FROM manufacturing.articles WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT text, edited_at, created_at FROM manufacturing.articles WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "Get payee_id, payment_date, invoice_number from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, payment_date, invoice_number FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, payment_date, invoice_number FROM manufacturing.billing WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by invoice_number descending?", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, payment_date, invoice_number FROM manufacturing.billing WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY invoice_number DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "List keywords, edited_at, likes from articles.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, edited_at, likes FROM manufacturing.articles;", "sql": null}, {"role": "user", "content": "List articles with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, edited_at, likes FROM manufacturing.articles WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate count of created_at for each keywords in articles.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, COUNT(created_at) AS count_created_at FROM manufacturing.articles GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.billing (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payment_date timestamp without time zone,\n payee_id character varying(256),\n invoice_number varchar NOT NULL,\n credit char\n)\n\nCREATE TABLE manufacturing.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n edited_at date,\n likes character varying(64) NOT NULL,\n text character varying(128),\n keywords character varying(256)\n)", "conversations": [{"role": "user", "content": "List payee_id, processed_at, credit from billing.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, processed_at, credit FROM manufacturing.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, processed_at, credit FROM manufacturing.billing WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by payee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, processed_at, credit FROM manufacturing.billing WHERE processed_at > '2023-01-01' ORDER BY payee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve product_id, video_url, published_at for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, video_url, published_at FROM government.catalog;", "sql": null}, {"role": "user", "content": "Get product_id, video_url, cancelled_at, payment_status by joining catalog with purchases.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, video_url, published_at, purchases.cancelled_at, purchases.payment_status FROM government.catalog JOIN government.purchases ON catalog.purchase_id = purchases.invoice_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, video_url, published_at, purchases.cancelled_at, purchases.payment_status FROM government.catalog JOIN government.purchases ON catalog.purchase_id = purchases.invoice_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve product_id, stock_level, rating for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, stock_level, rating FROM government.catalog;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, stock_level, rating FROM government.catalog ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of catalog in each purchase_id category.", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, COUNT(*) AS count FROM government.catalog GROUP BY purchase_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog;", "sql": null}, {"role": "user", "content": "Show the results sorted by purchase_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog ORDER BY purchase_id ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog ORDER BY purchase_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve product_id, stock_level, subcategory for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, stock_level, subcategory FROM government.catalog;", "sql": null}, {"role": "user", "content": "Find catalog created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, stock_level, subcategory FROM government.catalog WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, stock_level, subcategory FROM government.catalog WHERE updated_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog;", "sql": null}, {"role": "user", "content": "Can you order these by subcategory ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog ORDER BY subcategory ASC;", "sql": null}, {"role": "user", "content": "Can you order these by rating descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog ORDER BY rating DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "List all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog;", "sql": null}, {"role": "user", "content": "Show me catalog with product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of catalog across different published_at values.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM government.catalog GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me video_url, stock_level, published_at for all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, stock_level, published_at FROM government.catalog;", "sql": null}, {"role": "user", "content": "Sort the results by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, stock_level, published_at FROM government.catalog ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Tally up catalog by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM government.catalog GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the product_id, published_at, stock_level of each catalog?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, published_at, stock_level FROM government.catalog;", "sql": null}, {"role": "user", "content": "Get updated_at, video_url, fee, updated_at by joining catalog with purchases.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, published_at, stock_level, purchases.fee, purchases.updated_at FROM government.catalog JOIN government.purchases ON catalog.purchase_id = purchases.invoice_id;", "sql": null}, {"role": "user", "content": "Tally up catalog by video_url.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, COUNT(*) AS count FROM government.catalog GROUP BY video_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve subcategory, updated_at, stock_level for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, updated_at, stock_level FROM government.catalog;", "sql": null}, {"role": "user", "content": "Retrieve catalog where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, updated_at, stock_level FROM government.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group catalog by purchase_id and show the min of stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, MIN(stock_level) AS min_stock_level FROM government.catalog GROUP BY purchase_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.catalog (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n updated_at timestamp,\n video_url char NOT NULL,\n subcategory character varying(64),\n stock_level text,\n rating character varying(64) NOT NULL,\n purchase_id integer -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE government.purchases (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n updated_at date,\n currency character varying(64),\n fee char,\n payment_status char,\n seller_id character varying(128) -- identifier for seller,\n exchange_rate character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog;", "sql": null}, {"role": "user", "content": "Order the output by purchase_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.catalog ORDER BY purchase_id DESC;", "sql": null}, {"role": "user", "content": "Show me count of published_at grouped by published_at for catalog.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(published_at) AS count_published_at FROM government.catalog GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "What are the course_id, image_url, created_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT course_id, image_url, created_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, image_url, created_at FROM education.grades WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with image_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, image_url, created_at FROM education.grades WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY image_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "What are the image_url, created_at, featured_rank of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, created_at, featured_rank FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, created_at, featured_rank FROM education.grades WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.grades GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, updated_at, category for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, category FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, category FROM education.grades WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the max created_at for each category in grades?", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(created_at) AS max_created_at FROM education.grades GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Get grades that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "List image_url, category, updated_at from grades.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, category, updated_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, category, updated_at FROM education.grades ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, category, updated_at FROM education.grades ORDER BY updated_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Show me course_id, created_at, image_url for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, created_at, image_url FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, created_at, image_url FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, created_at, image_url FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by featured_rank ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY featured_rank ASC;", "sql": null}, {"role": "user", "content": "Count the number of grades in each course_id category.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, COUNT(*) AS count FROM education.grades GROUP BY course_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "What are the created_at, updated_at, category of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, category FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with featured_rank in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, category FROM education.grades ORDER BY featured_rank ASC;", "sql": null}, {"role": "user", "content": "How many grades are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.grades GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List category, course_id, birth_date, country for each grade along with their course information.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.birth_date, courses.country FROM education.grades JOIN education.courses ON grades.course_id = courses.customer_id;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.birth_date, courses.country FROM education.grades JOIN education.courses ON grades.course_id = courses.customer_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n image_url varchar NOT NULL,\n category char,\n featured_rank char NOT NULL,\n course_id text NOT NULL -- reference to courses.customer_id,\n FOREIGN KEY (course_id) REFERENCES courses(customer_id)\n)\n\nCREATE TABLE education.courses (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n country char NOT NULL,\n email char,\n birth_date date,\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Get grades that match category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of category grouped by updated_at for grades.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(category) AS max_category FROM education.grades GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve timezone, user_id, account_status for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, user_id, account_status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Arrange the results with website in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, user_id, account_status FROM e-commerce.shipping ORDER BY website ASC;", "sql": null}, {"role": "user", "content": "Order the output by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, user_id, account_status FROM e-commerce.shipping ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Show me account_status, user_id, id for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, user_id, id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Sort the results by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, user_id, id FROM e-commerce.shipping ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, user_id, id FROM e-commerce.shipping ORDER BY id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "List all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match account_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE account_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group shipping by updated_at and show the count of account_status.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(account_status) AS count_account_status FROM e-commerce.shipping GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, timezone, account_status for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, timezone, account_status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, timezone, account_status FROM e-commerce.shipping WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate count of updated_at for each account_status in shipping.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(updated_at) AS count_updated_at FROM e-commerce.shipping GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get all shipping between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve website, user_id, account_status for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT website, user_id, account_status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve account_status, user_id, full_name, updated_at showing the relationship between shipping and users.", "sql": null}, {"role": "assistant", "content": "SELECT website, user_id, account_status, users.full_name, users.updated_at FROM e-commerce.shipping JOIN e-commerce.users ON shipping.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Tally up shipping by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of id by updated_at from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(id) AS min_id FROM e-commerce.shipping GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Can you order these by timezone ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY timezone ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality text NOT NULL,\n address char NOT NULL,\n membership_level character varying(64),\n full_name character varying(128) NOT NULL,\n password_hash character varying(64),\n is_verified bit\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n timezone character varying(256),\n account_status character varying(128),\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Can you order these by id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Can you order these by is_verified ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY is_verified ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List location_lon, updated_at, postal_code from facilities.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, postal_code FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Find facilities where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, postal_code FROM travel.facilities WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, postal_code FROM travel.facilities WHERE user_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate max of last_login for each updated_at in users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(last_login) AS max_last_login FROM travel.users GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "List status, timezone, location_lon, user_id for each user along with their facilitie information.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.location_lon, facilities.user_id FROM travel.users JOIN travel.facilities ON users.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.location_lon, facilities.user_id FROM travel.users JOIN travel.facilities ON users.facilitie_id = facilities.address_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me is_verified, language, status for all users.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, language, status FROM travel.users;", "sql": null}, {"role": "user", "content": "Get users that match last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, language, status FROM travel.users WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different facilitie_id values.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, COUNT(*) AS count FROM travel.users GROUP BY facilitie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Show me facilities with street LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE street LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up facilities by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM travel.facilities GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, timezone, status for all users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, timezone, status FROM travel.users;", "sql": null}, {"role": "user", "content": "List users that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, timezone, status FROM travel.users WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, timezone, status FROM travel.users WHERE updated_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Retrieve facilities where location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE location_lon LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve location_lat, street, type for every facilitie.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, street, type FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Retrieve facilities where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, street, type FROM travel.facilities WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up facilities by type.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM travel.facilities GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language char NOT NULL,\n last_login timestamp without time zone NOT NULL,\n status character varying(64),\n is_verified bit,\n timezone character varying(256),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n latitude character varying(128),\n type character varying(128),\n location_lat character varying(64),\n street text,\n location_lon character varying(128),\n postal_code text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Sort the results by facilitie_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY facilitie_id DESC;", "sql": null}, {"role": "user", "content": "Group users by language and show the max of status.", "sql": null}, {"role": "assistant", "content": "SELECT language, MAX(status) AS max_status FROM travel.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get orders that match total > 65.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE total > 65;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE total > 65 LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve categorie_id, exchange_rate, updated_at for every order.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, exchange_rate, updated_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, exchange_rate, updated_at FROM e-commerce.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, exchange_rate, updated_at FROM e-commerce.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Order the output by categorie_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY categorie_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with total in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY total ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Order the output by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY card_type DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY card_type DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve card_type, total, keywords, tags showing the relationship between orders and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.keywords, categories.tags FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Count the number of orders in each categorie_id category.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(*) AS count FROM e-commerce.orders GROUP BY categorie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "List updated_at, total, categorie_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, total, categorie_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, total, categorie_id FROM e-commerce.orders ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, total, categorie_id FROM e-commerce.orders ORDER BY exchange_rate DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many orders are there per categorie_id?", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(*) AS count FROM e-commerce.orders GROUP BY categorie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, categorie_id, exchange_rate of each order?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, exchange_rate FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me exchange_rate, card_type, image_url, published_at from orders and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, exchange_rate, categories.image_url, categories.published_at FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, exchange_rate, categories.image_url, categories.published_at FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List orders with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n exchange_rate character varying(128),\n total decimal NOT NULL,\n card_type character varying(256),\n categorie_id integer -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n tags varchar,\n image_url char,\n score character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n created_at date,\n published_at timestamp,\n reserved text NOT NULL,\n backorder character varying(128),\n thumbnail_url character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of orders in each card_type category.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM e-commerce.orders GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "Show me all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show me likes that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of likes grouped by invoice_id.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Get likes that match processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up likes by buyer_id.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY buyer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "What invoice_id, user_id, message, attachment_url do we have for likes and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.message, messages.attachment_url FROM socialmedia.likes JOIN socialmedia.messages ON likes.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "What is the sum card_type for each card_type in likes?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, SUM(card_type) AS sum_card_type FROM socialmedia.likes GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "List processed_at, buyer_id, invoice_id from likes.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, buyer_id, invoice_id FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, buyer_id, invoice_id FROM socialmedia.likes WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up likes by message_id.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "Show me all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "List user_id, fee, processed_at from likes.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, fee, processed_at FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List processed_at, price, subject, views for each like along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, fee, processed_at, messages.subject, messages.views FROM socialmedia.likes JOIN socialmedia.messages ON likes.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Get min of price by fee from likes.", "sql": null}, {"role": "assistant", "content": "SELECT fee, MIN(price) AS min_price FROM socialmedia.likes GROUP BY fee;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "List fee, buyer_id, card_type from likes.", "sql": null}, {"role": "assistant", "content": "SELECT fee, buyer_id, card_type FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes that have message_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT fee, buyer_id, card_type FROM socialmedia.likes WHERE message_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of likes across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group likes by processed_at and show the sum of account_id.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, SUM(account_id) AS sum_account_id FROM socialmedia.likes GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the min account_id for each price in likes?", "sql": null}, {"role": "assistant", "content": "SELECT price, MIN(account_id) AS min_account_id FROM socialmedia.likes GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n fee text,\n card_type character varying(128),\n price decimal,\n buyer_id text -- identifier for buyer,\n account_id varchar,\n user_id text -- identifier for user,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at date,\n message char,\n thumbnail varchar NOT NULL,\n subject character varying(128),\n title char,\n attachment_url character varying(128),\n views char\n)", "conversations": [{"role": "user", "content": "Show me processed_at, user_id, message_id for all likes.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, user_id, message_id FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List fee, message_id, thumbnail, published_at for each like along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, user_id, message_id, messages.thumbnail, messages.published_at FROM socialmedia.likes JOIN socialmedia.messages ON likes.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Group likes by fee and show the average of price.", "sql": null}, {"role": "assistant", "content": "SELECT fee, AVERAGE(price) AS average_price FROM socialmedia.likes GROUP BY fee;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Order the output by video_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise ORDER BY video_url DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Retrieve account_id, video_url, payment_date, vendor_id showing the relationship between merchandise and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.payment_date, accounts.vendor_id FROM music.merchandise JOIN music.accounts ON merchandise.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Get min of name by updated_at from merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(name) AS min_name FROM music.merchandise GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Retrieve merchandise where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by video_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY video_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get name, id, video_url from all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT name, id, video_url FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Retrieve merchandise where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT name, id, video_url FROM music.merchandise WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate sum of video_url for each reserved in merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, SUM(video_url) AS sum_video_url FROM music.merchandise GROUP BY reserved;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me reserved, account_id, updated_at for all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, updated_at FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Show me reserved, popularity_score, reconciliation_status, notes from merchandise and their related accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, updated_at, accounts.reconciliation_status, accounts.notes FROM music.merchandise JOIN music.accounts ON merchandise.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Can you order these by id descending?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, updated_at, accounts.reconciliation_status, accounts.notes FROM music.merchandise JOIN music.accounts ON merchandise.account_id = accounts.id ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get name, popularity_score, reserved from all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT name, popularity_score, reserved FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Sort the results by video_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT name, popularity_score, reserved FROM music.merchandise ORDER BY video_url DESC;", "sql": null}, {"role": "user", "content": "Calculate min of popularity_score for each updated_at in merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(popularity_score) AS min_popularity_score FROM music.merchandise GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Show me merchandise with name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.merchandise WHERE name LIKE 'A%' ORDER BY popularity_score DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me name, updated_at, id for all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT name, updated_at, id FROM music.merchandise;", "sql": null}, {"role": "user", "content": "List merchandise that have video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, updated_at, id FROM music.merchandise WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of id by id from merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(id) AS min_id FROM music.merchandise GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the reserved, account_id, name of each merchandise?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, name FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Can you order these by id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, name FROM music.merchandise ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Show me average of updated_at grouped by name for merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT name, AVERAGE(updated_at) AS average_updated_at FROM music.merchandise GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.merchandise (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n name character varying(64) NOT NULL,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(128) NOT NULL,\n popularity_score varchar,\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE music.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n vendor_id char,\n user_id char -- identifier for user,\n notes character varying(256) NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n credit text\n)\n\nCREATE TABLE music.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax smallint,\n seller_id character varying(256),\n quantity varchar NOT NULL,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the reserved, account_id, popularity_score of each merchandise?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, popularity_score FROM music.merchandise;", "sql": null}, {"role": "user", "content": "Get video_url, popularity_score, notes, vendor_id by joining merchandise with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, popularity_score, accounts.notes, accounts.vendor_id FROM music.merchandise JOIN music.accounts ON merchandise.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, account_id, popularity_score, accounts.notes, accounts.vendor_id FROM music.merchandise JOIN music.accounts ON merchandise.account_id = accounts.id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List backorder, order_item_id, is_active, salt for each product along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.is_active, users.salt FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.is_active, users.salt FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, user_id, order_item_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, order_item_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, order_item_id FROM e-commerce.products WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by barcode ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, order_item_id FROM e-commerce.products WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY barcode ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by order_item_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY order_item_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me backorder, order_item_id, barcode for all products.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, order_item_id, barcode FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What user_id, thumbnail_url, salt, is_active do we have for products and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, order_item_id, barcode, users.salt, users.is_active FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, order_item_id, barcode, users.salt, users.is_active FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, backorder, order_item_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, order_item_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by barcode descending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, order_item_id FROM e-commerce.products ORDER BY barcode DESC;", "sql": null}, {"role": "user", "content": "Can you order these by thumbnail_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, order_item_id FROM e-commerce.products ORDER BY thumbnail_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY thumbnail_url DESC;", "sql": null}, {"role": "user", "content": "Can you order these by order_item_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY order_item_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me user_id, updated_at, thumbnail_url for all products.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, thumbnail_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, thumbnail_url FROM e-commerce.products WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with order_item_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, thumbnail_url FROM e-commerce.products WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY order_item_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "What are the thumbnail_url, updated_at, backorder of each product?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, backorder FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What order_item_id, updated_at, is_active, bio do we have for products and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, backorder, users.is_active, users.bio FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id;", "sql": null}, {"role": "user", "content": "Tally up products by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.products GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by user_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "What is the count backorder for each updated_at in products?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(backorder) AS count_backorder FROM e-commerce.products GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n debit text NOT NULL,\n vendor_id varchar,\n approval_status character varying(256),\n status character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n display_name text,\n password_hash character varying(256),\n salt text,\n is_active boolean -- indicates if active is true,\n bio char NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n thumbnail_url text NOT NULL,\n backorder text,\n user_id text -- reference to users.id,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by order_item_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY order_item_id DESC;", "sql": null}, {"role": "user", "content": "Sort the results by thumbnail_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY thumbnail_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get average of published_at by parent_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, AVERAGE(published_at) AS average_published_at FROM socialmedia.messages GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY media_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY media_url DESC;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by follower_id.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by thumbnail ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY thumbnail ASC;", "sql": null}, {"role": "user", "content": "Count the number of messages in each media_url category.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM socialmedia.messages GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE updated_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List parent_id, reply_to_id, created_at, video_url for each message along with their follower information.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.video_url FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.product_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.video_url FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.product_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM socialmedia.messages GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me thumbnail, message_id, created_at, thumbnail_url from messages and their related followers.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.thumbnail_url FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.product_id;", "sql": null}, {"role": "user", "content": "Group messages by updated_at and show the min of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(published_at) AS min_published_at FROM socialmedia.messages GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List published_at, follower_id, description from messages.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, follower_id, description FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, follower_id, description FROM socialmedia.messages WHERE score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, follower_id, description FROM socialmedia.messages WHERE score LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n score text,\n description varchar,\n reply_to_id character varying(64),\n media_url text,\n thumbnail char,\n parent_id text -- identifier for parent,\n follower_id text NOT NULL -- reference to followers.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n title text,\n currency text NOT NULL,\n thumbnail_url character varying(64),\n video_url varchar -- identifier for video_url,\n discount bigint,\n media_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n msrp char,\n discount bigint NOT NULL,\n brand char,\n available character varying(128),\n video_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by thumbnail descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY thumbnail DESC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY thumbnail DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get max of display_name by display_name from departments.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, MAX(display_name) AS max_display_name FROM education.departments GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List language, website, display_name from students.", "sql": null}, {"role": "assistant", "content": "SELECT language, website, display_name FROM education.students;", "sql": null}, {"role": "user", "content": "Get state, bio, website, age by joining students with departments.", "sql": null}, {"role": "assistant", "content": "SELECT language, website, display_name, departments.website, departments.age FROM education.students JOIN education.departments ON students.department_id = departments.employee_id;", "sql": null}, {"role": "user", "content": "Show me count of language grouped by department_id for students.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, COUNT(language) AS count_language FROM education.students GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List age, website, student_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT age, website, student_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT age, website, student_id FROM education.departments WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group departments by display_name and show the sum of age.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, SUM(age) AS sum_age FROM education.departments GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by website.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(*) AS count FROM education.departments GROUP BY website ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments with website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different display_name values.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.departments GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM education.departments GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me display_name, age, joined_at, language from departments and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.joined_at, students.language FROM education.departments JOIN education.students ON departments.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Calculate max of student_id for each last_active in departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, MAX(student_id) AS max_student_id FROM education.departments GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n display_name character varying(64) NOT NULL,\n website varchar,\n state text NOT NULL,\n language character varying(64),\n bio char NOT NULL,\n department_id integer NOT NULL -- reference to departments.employee_id,\n teacher_id text NOT NULL -- reference to teachers.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(employee_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(account_id)\n)\n\nCREATE TABLE education.teachers (\n account_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n invoice_number char,\n description text,\n reference_number character varying(128)\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n website varchar,\n display_name char,\n age text NOT NULL,\n student_id integer -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)", "conversations": [{"role": "user", "content": "List state, bio, joined_at from students.", "sql": null}, {"role": "assistant", "content": "SELECT state, bio, joined_at FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT state, bio, joined_at FROM education.students WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of teacher_id for each joined_at in students.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, SUM(teacher_id) AS sum_teacher_id FROM education.students GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n first_name character varying(64),\n account_status char,\n api_key character varying(64),\n is_verified bit NOT NULL -- indicates if verified is true,\n membership_level character varying(64),\n address varchar,\n country character varying(256)\n)\n\nCREATE TABLE finance.investments (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n longitude text,\n description character varying(64),\n parking_available character varying(64),\n country char,\n payment_id integer -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.loans (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n operating_hours varchar,\n name char NOT NULL,\n type varchar,\n geo_point character varying(64),\n postal_code character varying(64)\n)\n\nCREATE TABLE finance.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n exchange_rate varchar,\n card_type character varying(128),\n user_id character varying(256) -- identifier for user,\n seller_id character varying(256),\n delivery_status varchar,\n price numeric NOT NULL,\n loan_id text -- reference to loans.store_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Group investments by payment_id and show the max of payment_id.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, MAX(payment_id) AS max_payment_id FROM finance.investments GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n first_name character varying(64),\n account_status char,\n api_key character varying(64),\n is_verified bit NOT NULL -- indicates if verified is true,\n membership_level character varying(64),\n address varchar,\n country character varying(256)\n)\n\nCREATE TABLE finance.investments (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n longitude text,\n description character varying(64),\n parking_available character varying(64),\n country char,\n payment_id integer -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.loans (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n operating_hours varchar,\n name char NOT NULL,\n type varchar,\n geo_point character varying(64),\n postal_code character varying(64)\n)\n\nCREATE TABLE finance.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n exchange_rate varchar,\n card_type character varying(128),\n user_id character varying(256) -- identifier for user,\n seller_id character varying(256),\n delivery_status varchar,\n price numeric NOT NULL,\n loan_id text -- reference to loans.store_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match price > 75.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE price > 75;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE price > 75 ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n first_name character varying(64),\n account_status char,\n api_key character varying(64),\n is_verified bit NOT NULL -- indicates if verified is true,\n membership_level character varying(64),\n address varchar,\n country character varying(256)\n)\n\nCREATE TABLE finance.investments (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n longitude text,\n description character varying(64),\n parking_available character varying(64),\n country char,\n payment_id integer -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.loans (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n operating_hours varchar,\n name char NOT NULL,\n type varchar,\n geo_point character varying(64),\n postal_code character varying(64)\n)\n\nCREATE TABLE finance.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n exchange_rate varchar,\n card_type character varying(128),\n user_id character varying(256) -- identifier for user,\n seller_id character varying(256),\n delivery_status varchar,\n price numeric NOT NULL,\n loan_id text -- reference to loans.store_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-12-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the msrp, quantity, stock_level of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT msrp, quantity, stock_level FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, quantity, stock_level FROM finance.loans WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, quantity, stock_level FROM finance.loans WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List audit_id, updated_at, quantity from loans.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, updated_at, quantity FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, updated_at, quantity FROM finance.loans ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, updated_at, quantity FROM finance.loans ORDER BY id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get audit_id, tax_rate, updated_at from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, tax_rate, updated_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, tax_rate, updated_at FROM finance.loans WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, tax_rate, updated_at FROM finance.loans WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many loans are there per id?", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM finance.loans GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where msrp LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE msrp LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE msrp LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the id, updated_at, audit_id of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT id, updated_at, audit_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by msrp ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, updated_at, audit_id FROM finance.loans ORDER BY msrp ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different audit_id values.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, COUNT(*) AS count FROM finance.loans GROUP BY audit_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me sum of tax_rate grouped by audit_id for loans.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, SUM(tax_rate) AS sum_tax_rate FROM finance.loans GROUP BY audit_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the updated_at, quantity, featured_rank of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, featured_rank FROM finance.loans;", "sql": null}, {"role": "user", "content": "Order the output by tax_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, featured_rank FROM finance.loans ORDER BY tax_rate DESC;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, featured_rank FROM finance.loans ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Sort the results by tax_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY tax_rate ASC;", "sql": null}, {"role": "user", "content": "Can you order these by tax_rate descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY tax_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n quantity varchar NOT NULL,\n msrp char,\n featured_rank varchar,\n title character varying(256),\n tax_rate character varying(256),\n stock_level character varying(64),\n audit_id text NOT NULL -- reference to audits.product_id,\n FOREIGN KEY (audit_id) REFERENCES audits(product_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(256)\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n currency character varying(128),\n description text NOT NULL,\n payee_id character varying(256) -- identifier for payee,\n reconciliation_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.audits (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(128) NOT NULL,\n stock_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List updated_at, quantity, audit_id from loans.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, audit_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, audit_id FROM finance.loans ORDER BY stock_level ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with audit_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, quantity, audit_id FROM finance.loans ORDER BY audit_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by views ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY views ASC;", "sql": null}, {"role": "user", "content": "Show me max of user_id grouped by reply_to_id for groups.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, MAX(user_id) AS max_user_id FROM socialmedia.groups GROUP BY reply_to_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get gender, created_at, reply_to_id, user_id by joining users with comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.reply_to_id, comments.user_id FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.content_id;", "sql": null}, {"role": "user", "content": "Tally up users by gender.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM socialmedia.users GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY edited_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Get content, user_id, description from all groups.", "sql": null}, {"role": "assistant", "content": "SELECT content, user_id, description FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Arrange the results with views in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT content, user_id, description FROM socialmedia.groups ORDER BY views DESC;", "sql": null}, {"role": "user", "content": "Tally up groups by content.", "sql": null}, {"role": "assistant", "content": "SELECT content, COUNT(*) AS count FROM socialmedia.groups GROUP BY content ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of thumbnail by content from groups.", "sql": null}, {"role": "assistant", "content": "SELECT content, AVERAGE(thumbnail) AS average_thumbnail FROM socialmedia.groups GROUP BY content;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Show me edited_at, keywords, user_id for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, keywords, user_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, keywords, user_id FROM socialmedia.comments WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up comments by edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM socialmedia.comments GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Show me score, edited_at, reply_to_id for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT score, edited_at, reply_to_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get all comments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT score, edited_at, reply_to_id FROM socialmedia.comments WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the average reply_to_id for each user_id in comments?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(reply_to_id) AS average_reply_to_id FROM socialmedia.comments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, content, reply_to_id for every group.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, content, reply_to_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me published_at, reply_to_id, last_login, comment_id from groups and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, content, reply_to_id, users.last_login, users.comment_id FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.id;", "sql": null}, {"role": "user", "content": "What is the average user_id for each views in groups?", "sql": null}, {"role": "assistant", "content": "SELECT views, AVERAGE(user_id) AS average_user_id FROM socialmedia.groups GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve score, keywords, comment_id, last_login showing the relationship between comments and users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.comment_id, users.last_login FROM socialmedia.comments JOIN socialmedia.users ON comments.user_id = users.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.comment_id, users.last_login FROM socialmedia.comments JOIN socialmedia.users ON comments.user_id = users.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n display_name character varying(128),\n website character varying(256) NOT NULL,\n last_login timestamp without time zone,\n country character varying(256) NOT NULL,\n comment_id text NOT NULL -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.groups (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n content varchar,\n views text,\n thumbnail varchar,\n reply_to_id character varying(256) NOT NULL,\n description character varying(64),\n image_url character varying(256) NOT NULL,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n score character varying(64),\n keywords character varying(256) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get last_login, display_name, edited_at, score by joining users with comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.edited_at, comments.score FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.content_id;", "sql": null}, {"role": "user", "content": "Can you order these by gender ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.edited_at, comments.score FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.content_id ORDER BY gender ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List user_id, payment_status, status from payments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, payment_status, status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me currency, investment_id, completed_at, quantity from payments and their related investments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, payment_status, status, investments.completed_at, investments.quantity FROM finance.payments JOIN finance.investments ON payments.investment_id = investments.transaction_id;", "sql": null}, {"role": "user", "content": "Calculate sum of buyer_id for each updated_at in payments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(buyer_id) AS sum_buyer_id FROM finance.payments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE product_id LIKE 'A%' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE buyer_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show the results sorted by investment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY investment_id ASC;", "sql": null}, {"role": "user", "content": "How many payments are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.payments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me investment_id, product_id, updated_at for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, product_id, updated_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, product_id, updated_at FROM finance.payments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different product_id values.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM finance.payments GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the count payment_status for each payment_status in payments?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(payment_status) AS count_payment_status FROM finance.payments GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get product_id, buyer_id, investment_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, buyer_id, investment_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "What investment_id, buyer_id, completed_at, cancelled_at do we have for payments and their associated investments?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, buyer_id, investment_id, investments.completed_at, investments.cancelled_at FROM finance.payments JOIN finance.investments ON payments.investment_id = investments.transaction_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by investment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, buyer_id, investment_id, investments.completed_at, investments.cancelled_at FROM finance.payments JOIN finance.investments ON payments.investment_id = investments.transaction_id ORDER BY investment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different investment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, COUNT(*) AS count FROM finance.payments GROUP BY investment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payment_status char NOT NULL,\n currency character varying(128) NOT NULL,\n user_id character varying(256),\n buyer_id char -- identifier for buyer,\n product_id character varying(128) NOT NULL -- identifier for product,\n status varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.transaction_id,\n FOREIGN KEY (investment_id) REFERENCES investments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at date,\n quantity character varying(128),\n currency character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, product_id, investment_id for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, product_id, investment_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where investment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, product_id, investment_id FROM finance.payments WHERE investment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, product_id, investment_id FROM finance.payments WHERE investment_id LIKE 'A%' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "What are the location_lat, state, timezone of each event?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, state, timezone FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get all events created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, state, timezone FROM socialmedia.events WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, state, timezone FROM socialmedia.events WHERE updated_at > '2023-12-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Retrieve keywords, comment_id, created_at for every post.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, comment_id, created_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, comment_id, created_at FROM socialmedia.posts WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, comment_id, created_at FROM socialmedia.posts WHERE created_at > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "What are the like_id, city, capacity of each event?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, city, capacity FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, city, capacity FROM socialmedia.events WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, city, capacity FROM socialmedia.events WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of events across different like_id values.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, COUNT(*) AS count FROM socialmedia.events GROUP BY like_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Show me all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match keywords LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE keywords LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of posts grouped by keywords.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, COUNT(*) AS count FROM socialmedia.posts GROUP BY keywords ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Show me timezone, city, coordinates for all events.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, city, coordinates FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, capacity, thumbnail_url, category showing the relationship between events and likes.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, city, coordinates, likes.thumbnail_url, likes.category FROM socialmedia.events JOIN socialmedia.likes ON events.like_id = likes.barcode;", "sql": null}, {"role": "user", "content": "Arrange the results with like_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, city, coordinates, likes.thumbnail_url, likes.category FROM socialmedia.events JOIN socialmedia.likes ON events.like_id = likes.barcode ORDER BY like_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get capacity, last_inspected, updated_at, created_at by joining events with likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.updated_at, likes.created_at FROM socialmedia.events JOIN socialmedia.likes ON events.like_id = likes.barcode;", "sql": null}, {"role": "user", "content": "Count the number of events in each timezone category.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM socialmedia.events GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "Retrieve location_lat, last_inspected, state for every event.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, last_inspected, state FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, last_inspected, state FROM socialmedia.events ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Calculate max of last_inspected for each state in events.", "sql": null}, {"role": "assistant", "content": "SELECT state, MAX(last_inspected) AS max_last_inspected FROM socialmedia.events GROUP BY state;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n views character varying(256),\n keywords char NOT NULL,\n categories varchar,\n event_id integer NOT NULL -- reference to events.id,\n like_id text NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (event_id) REFERENCES events(id),\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.events (\n id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n timezone character varying(128),\n capacity varchar NOT NULL,\n state character varying(256),\n city character varying(256),\n coordinates text NOT NULL,\n location_lat character varying(256) NOT NULL,\n like_id text -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n thumbnail_url varchar,\n category character varying(256),\n video_url text NOT NULL -- identifier for video_url\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many events are there per city?", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM socialmedia.events GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by message_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY message_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY message_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve is_active, joined_at, api_key for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, joined_at, api_key FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers that have bio LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, joined_at, api_key FROM socialmedia.followers WHERE bio LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many followers are there per is_active?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(*) AS count FROM socialmedia.followers GROUP BY is_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reply_to_id, categories, user_id for every message.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, categories, user_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve categories, updated_at, bio, joined_at showing the relationship between messages and followers.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, categories, user_id, followers.bio, followers.joined_at FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.user_id;", "sql": null}, {"role": "user", "content": "How many messages are there per description?", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM socialmedia.messages GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, follower_id, subject for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, follower_id, subject FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List follower_id, updated_at, message_id, api_key for each message along with their follower information.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, follower_id, subject, followers.message_id, followers.api_key FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different description values.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM socialmedia.messages GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Arrange the results with description in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY description ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me reply_to_id, follower_id, updated_at for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, follower_id, updated_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List follower_id, subject, created_at, api_key for each message along with their follower information.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, follower_id, updated_at, followers.created_at, followers.api_key FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.user_id;", "sql": null}, {"role": "user", "content": "Show me max of categories grouped by updated_at for messages.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(categories) AS max_categories FROM socialmedia.messages GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What updated_at, user_id, created_at, message_id do we have for messages and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.message_id FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.user_id;", "sql": null}, {"role": "user", "content": "Calculate max of categories for each updated_at in messages.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(categories) AS max_categories FROM socialmedia.messages GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Get categories, follower_id, updated_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT categories, follower_id, updated_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get messages that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT categories, follower_id, updated_at FROM socialmedia.messages WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT categories, follower_id, updated_at FROM socialmedia.messages WHERE updated_at > '2023-01-01' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group followers by created_at and show the average of message_id.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, AVERAGE(message_id) AS average_message_id FROM socialmedia.followers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n is_active bit,\n bio character varying(64) NOT NULL,\n api_key character varying(64),\n salt varchar NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject text,\n categories char NOT NULL,\n user_id text NOT NULL -- identifier for user,\n reply_to_id character varying(256) NOT NULL,\n description text,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Count the number of followers in each bio category.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM socialmedia.followers GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate sum of visibility for each keywords in departments.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, SUM(visibility) AS sum_visibility FROM healthcare.departments GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE published_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve medical_records where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM healthcare.medical_records GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me user_id, keywords, published_at for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, keywords, published_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where visibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, keywords, published_at FROM healthcare.departments WHERE visibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by attachment_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, keywords, published_at FROM healthcare.departments WHERE visibility LIKE 'A%' ORDER BY attachment_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Sort the results by keywords ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY keywords ASC;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me published_at, thumbnail, user_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, user_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, user_id FROM healthcare.departments WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, user_id FROM healthcare.departments WHERE published_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get id, created_at, operating_hours from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT id, created_at, operating_hours FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records that have capacity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, created_at, operating_hours FROM healthcare.medical_records WHERE capacity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by operating_hours ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, created_at, operating_hours FROM healthcare.medical_records WHERE capacity LIKE 'A%' ORDER BY operating_hours ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get count of attachment_url by thumbnail from departments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, COUNT(attachment_url) AS count_attachment_url FROM healthcare.departments GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get capacity, accessibility, created_at from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, accessibility, created_at FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show the results sorted by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, accessibility, created_at FROM healthcare.medical_records ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Calculate average of id for each capacity in medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, AVERAGE(id) AS average_id FROM healthcare.medical_records GROUP BY capacity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n visibility char NOT NULL,\n attachment_url character varying(128) NOT NULL,\n user_id varchar -- identifier for user,\n thumbnail character varying(64) NOT NULL,\n keywords text NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n capacity character varying(64),\n operating_hours text,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me count of operating_hours grouped by id for medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(operating_hours) AS count_operating_hours FROM healthcare.medical_records GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by likes ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY likes ASC;", "sql": null}, {"role": "user", "content": "Tally up reviews by post_id.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY post_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me created_at, status, phone for all users.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, phone FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, phone FROM e-commerce.users WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with phone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, phone FROM e-commerce.users WHERE id LIKE 'A%' ORDER BY phone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve id, phone, status for every user.", "sql": null}, {"role": "assistant", "content": "SELECT id, phone, status FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT id, phone, status FROM e-commerce.users WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the average phone for each status in users?", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(phone) AS average_phone FROM e-commerce.users GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE created_at > '2023-12-01' ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "List message, created_at, rating from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT message, created_at, rating FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT message, created_at, rating FROM e-commerce.reviews WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get the distribution of reviews across different message values.", "sql": null}, {"role": "assistant", "content": "SELECT message, COUNT(*) AS count FROM e-commerce.reviews GROUP BY message ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users with phone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE phone LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average created_at for each status in users?", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(created_at) AS average_created_at FROM e-commerce.users GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the rating, likes, updated_at of each review?", "sql": null}, {"role": "assistant", "content": "SELECT rating, likes, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where message LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT rating, likes, updated_at FROM e-commerce.reviews WHERE message LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up reviews by likes.", "sql": null}, {"role": "assistant", "content": "SELECT likes, COUNT(*) AS count FROM e-commerce.reviews GROUP BY likes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the id, phone, status of each user?", "sql": null}, {"role": "assistant", "content": "SELECT id, phone, status FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT id, phone, status FROM e-commerce.users WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, phone, status FROM e-commerce.users WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n message varchar NOT NULL,\n user_id text -- identifier for user,\n likes character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128) NOT NULL,\n status character varying(128)\n)", "conversations": [{"role": "user", "content": "List likes, post_id, rating from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT likes, post_id, rating FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT likes, post_id, rating FROM e-commerce.reviews WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many reviews are there per message?", "sql": null}, {"role": "assistant", "content": "SELECT message, COUNT(*) AS count FROM e-commerce.reviews GROUP BY message ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Retrieve rating, created_at, thumbnail_url for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT rating, created_at, thumbnail_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT rating, created_at, thumbnail_url FROM tradingplatform.assets WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, created_at, thumbnail_url FROM tradingplatform.assets WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, seller_id, traded_at for all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, traded_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get fee, traded_at, created_at, full_name by joining metadata with users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, traded_at, users.created_at, users.full_name FROM tradingplatform.metadata JOIN tradingplatform.users ON metadata.user_id = users.id;", "sql": null}, {"role": "user", "content": "How many metadata are there per asset_id?", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY asset_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Get user_id, buyer_id, updated_at from all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, buyer_id, updated_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, buyer_id, updated_at FROM tradingplatform.metadata WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of updated_at grouped by status for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT status, SUM(updated_at) AS sum_updated_at FROM tradingplatform.metadata GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Get all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "What is the min subcategory for each subcategory in assets?", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, MIN(subcategory) AS min_subcategory FROM tradingplatform.assets GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Show me rating, subcategory, thumbnail_url for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT rating, subcategory, thumbnail_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT rating, subcategory, thumbnail_url FROM tradingplatform.assets WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of thumbnail_url grouped by user_id for assets.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(thumbnail_url) AS average_thumbnail_url FROM tradingplatform.assets GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE seller_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE account_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail_url, user_id, subcategory for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, user_id, subcategory FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Sort the results by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, user_id, subcategory FROM tradingplatform.assets ORDER BY subcategory DESC;", "sql": null}, {"role": "user", "content": "Show me count of created_at grouped by name for assets.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(created_at) AS count_created_at FROM tradingplatform.assets GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "What are the asset_id, payment_id, tax of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, payment_id, tax FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Arrange the results with fee in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, payment_id, tax FROM tradingplatform.metadata ORDER BY fee DESC;", "sql": null}, {"role": "user", "content": "Tally up metadata by fee.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subcategory character varying(128) NOT NULL,\n thumbnail_url character varying(64),\n rating text,\n name text NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n first_name text NOT NULL,\n profile_picture_url text,\n username text NOT NULL,\n full_name character varying(128),\n country varchar NOT NULL,\n state character varying(256),\n token character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n updated_at date,\n status character varying(256),\n delivery_status char,\n fee text,\n seller_id varchar NOT NULL,\n account_id character varying(256),\n buyer_id char -- identifier for buyer,\n tax bigint NOT NULL,\n user_id text -- reference to users.id,\n asset_id text NOT NULL -- reference to assets.id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE status LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Get assignment_id, last_active, email from all students.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, last_active, email FROM education.students;", "sql": null}, {"role": "user", "content": "Arrange the results with last_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, last_active, email FROM education.students ORDER BY last_name ASC;", "sql": null}, {"role": "user", "content": "Get min of last_name by status from students.", "sql": null}, {"role": "assistant", "content": "SELECT status, MIN(last_name) AS min_last_name FROM education.students GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "List last_name, assignment_id, status from students.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, assignment_id, status FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by gender descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, assignment_id, status FROM education.students ORDER BY gender DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, assignment_id, status FROM education.students ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by salt descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active <= CURRENT_DATE - INTERVAL '6 months' ORDER BY salt DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by assignment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days' ORDER BY assignment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me email, salt, status for all students.", "sql": null}, {"role": "assistant", "content": "SELECT email, salt, status FROM education.students;", "sql": null}, {"role": "user", "content": "Arrange the results with salt in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT email, salt, status FROM education.students ORDER BY salt DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different email values.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM education.students GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the salt, assignment_id, last_active of each student?", "sql": null}, {"role": "assistant", "content": "SELECT salt, assignment_id, last_active FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT salt, assignment_id, last_active FROM education.students WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of last_active by status from students.", "sql": null}, {"role": "assistant", "content": "SELECT status, MAX(last_active) AS max_last_active FROM education.students GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me assignment_id, salt, email for all students.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, salt, email FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by last_active descending?", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, salt, email FROM education.students ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different email values.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM education.students GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n gender character varying(128),\n salt char NOT NULL,\n last_name character varying(256) NOT NULL,\n email varchar NOT NULL,\n status character varying(256),\n assignment_id integer -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at timestamp without time zone,\n currency char,\n product_id character varying(64) NOT NULL -- identifier for product,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match assignment_id > 91.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE assignment_id > 91;", "sql": null}, {"role": "user", "content": "Sort the results by salt descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE assignment_id > 91 ORDER BY salt DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by password_hash.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM e-commerce.order_items GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Show me categorie_id, employee_id, password_hash for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, employee_id, password_hash FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, employee_id, password_hash FROM e-commerce.order_items ORDER BY account_status ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with password_hash in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, employee_id, password_hash FROM e-commerce.order_items ORDER BY password_hash ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Show me state, account_status, website for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT state, account_status, website FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT state, account_status, website FROM e-commerce.order_items WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT state, account_status, website FROM e-commerce.order_items WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "List last_active, website, categorie_id from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, categorie_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, categorie_id FROM e-commerce.order_items WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Calculate sum of categorie_id for each created_at in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(categorie_id) AS sum_categorie_id FROM e-commerce.order_items GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me categorie_id, password_hash, nationality, email from order_items and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.nationality, categories.email FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.person_id;", "sql": null}, {"role": "user", "content": "Tally up order_items by state.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM e-commerce.order_items GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Get last_active, state, password_hash from all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, state, password_hash FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, state, password_hash FROM e-commerce.order_items WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, state, password_hash FROM e-commerce.order_items WHERE last_active >= CURRENT_DATE - INTERVAL '30 days' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "List employee_id, website, password_hash from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, website, password_hash FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me last_active, employee_id, nationality, display_name from order_items and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, website, password_hash, categories.nationality, categories.display_name FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.person_id;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, website, password_hash, categories.nationality, categories.display_name FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.person_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "List website, password_hash, employee_id from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT website, password_hash, employee_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List state, categorie_id, last_active, address for each order_item along with their categorie information.", "sql": null}, {"role": "assistant", "content": "SELECT website, password_hash, employee_id, categories.last_active, categories.address FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.person_id;", "sql": null}, {"role": "user", "content": "Sort the results by password_hash ascending.", "sql": null}, {"role": "assistant", "content": "SELECT website, password_hash, employee_id, categories.last_active, categories.address FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.person_id ORDER BY password_hash ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256),\n password_hash character varying(64),\n state char NOT NULL,\n account_status character varying(128),\n categorie_id text NOT NULL -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active timestamp without time zone,\n last_name text,\n address character varying(128) NOT NULL,\n display_name character varying(128),\n nationality character varying(64),\n email text\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group order_items by employee_id and show the average of state.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, AVERAGE(state) AS average_state FROM e-commerce.order_items GROUP BY employee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve city, course_id, created_at for every student.", "sql": null}, {"role": "assistant", "content": "SELECT city, course_id, created_at FROM education.students;", "sql": null}, {"role": "user", "content": "Find students created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT city, course_id, created_at FROM education.students WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group students by city and show the min of username.", "sql": null}, {"role": "assistant", "content": "SELECT city, MIN(username) AS min_username FROM education.students GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, course_id, created_at, image_url showing the relationship between students and courses.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.created_at, courses.image_url FROM education.students JOIN education.courses ON students.course_id = courses.message_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.created_at, courses.image_url FROM education.students JOIN education.courses ON students.course_id = courses.message_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE updated_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show me count of status grouped by course_id for students.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, COUNT(status) AS count_status FROM education.students GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, course_id, username for every student.", "sql": null}, {"role": "assistant", "content": "SELECT status, course_id, username FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, course_id, username FROM education.students WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, course_id, username FROM education.students WHERE username LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "What created_at, city, parent_id, keywords do we have for students and their associated courses?", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.parent_id, courses.keywords FROM education.students JOIN education.courses ON students.course_id = courses.message_id;", "sql": null}, {"role": "user", "content": "What is the average username for each status in students?", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(username) AS average_username FROM education.students GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up students by status.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM education.students GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "What are the status, city, username of each student?", "sql": null}, {"role": "assistant", "content": "SELECT status, city, username FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT status, city, username FROM education.students WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many students are there per username?", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(*) AS count FROM education.students GROUP BY username ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Tally up students by status.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM education.students GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n rating character varying(128),\n image_url character varying(128) NOT NULL,\n parent_id character varying(64) -- identifier for parent,\n text character varying(128),\n keywords character varying(128) NOT NULL\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n processed_at timestamp,\n card_type char NOT NULL,\n approval_status char NOT NULL,\n amount decimal NOT NULL,\n discount bigint,\n customer_id text,\n payment_status text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp,\n keywords varchar,\n format character varying(256) NOT NULL,\n user_id character varying(128) NOT NULL -- identifier for user,\n subject char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n status text,\n username character varying(128),\n city varchar NOT NULL,\n course_id text NOT NULL -- reference to courses.message_id,\n FOREIGN KEY (course_id) REFERENCES courses(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by course_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY course_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different city values.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM education.students GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "What are the student_id, views, shares of each department?", "sql": null}, {"role": "assistant", "content": "SELECT student_id, views, shares FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, views, shares FROM education.departments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, views, shares FROM education.departments WHERE updated_at > '2023-12-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me zip_code, is_active, website for all students.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, is_active, website FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, is_active, website FROM education.students WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up students by is_active.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(*) AS count FROM education.students GROUP BY is_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "List zip_code, created_at, department_id from students.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, department_id FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by department_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, department_id FROM education.students ORDER BY department_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by zip_code ascending?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, department_id FROM education.students ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Get thumbnail, created_at, shares from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, created_at, shares FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where student_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, created_at, shares FROM education.departments WHERE student_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of rating for each shares in departments.", "sql": null}, {"role": "assistant", "content": "SELECT shares, AVERAGE(rating) AS average_rating FROM education.departments GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me department_id, is_active, created_at for all students.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, is_active, created_at FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve department_id, is_active, thumbnail, updated_at showing the relationship between students and departments.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, is_active, created_at, departments.thumbnail, departments.updated_at FROM education.students JOIN education.departments ON students.department_id = departments.content_id;", "sql": null}, {"role": "user", "content": "Calculate count of created_at for each website in students.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(created_at) AS count_created_at FROM education.students GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, rating, views for every department.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, rating, views FROM education.departments;", "sql": null}, {"role": "user", "content": "What format, shares, website, department_id do we have for departments and their associated students?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, rating, views, students.website, students.department_id FROM education.departments JOIN education.students ON departments.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, rating, views, students.website, students.department_id FROM education.departments JOIN education.students ON departments.student_id = students.employee_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by shares descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY shares DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me format, student_id, rating for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT format, student_id, rating FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments with shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT format, student_id, rating FROM education.departments WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT format, student_id, rating FROM education.departments WHERE shares LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "List zip_code, created_at, website from students.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, website FROM education.students;", "sql": null}, {"role": "user", "content": "Find students from last week.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, website FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Order the output by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, website FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views character varying(64),\n rating character varying(64),\n shares character varying(128),\n format char,\n thumbnail character varying(256),\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n is_active boolean,\n zip_code character varying(64),\n website text NOT NULL,\n department_id text -- reference to departments.content_id,\n FOREIGN KEY (department_id) REFERENCES departments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me format, views, student_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT format, views, student_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Get all departments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT format, views, student_id FROM education.departments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate sum of student_id for each student_id in departments.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, SUM(student_id) AS sum_student_id FROM education.departments GROUP BY student_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n street character varying(128),\n country character varying(128) NOT NULL,\n type text,\n capacity text,\n billin_id integer NOT NULL -- reference to billing.invoice_id,\n appointment_id text -- reference to appointments.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp,\n notes char,\n exchange_rate character varying(256),\n reference_number varchar,\n balance bigint,\n customer_id character varying(128) -- identifier for customer,\n appointment_id text NOT NULL -- reference to appointments.customer_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n last_login timestamp,\n age text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n joined_at date,\n status varchar,\n last_login date NOT NULL,\n salt text,\n api_key char,\n first_name character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where reference_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE reference_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE reference_number LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n street character varying(128),\n country character varying(128) NOT NULL,\n type text,\n capacity text,\n billin_id integer NOT NULL -- reference to billing.invoice_id,\n appointment_id text -- reference to appointments.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp,\n notes char,\n exchange_rate character varying(256),\n reference_number varchar,\n balance bigint,\n customer_id character varying(128) -- identifier for customer,\n appointment_id text NOT NULL -- reference to appointments.customer_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n last_login timestamp,\n age text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n joined_at date,\n status varchar,\n last_login date NOT NULL,\n salt text,\n api_key char,\n first_name character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Sort the results by notes descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY notes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n street character varying(128),\n country character varying(128) NOT NULL,\n type text,\n capacity text,\n billin_id integer NOT NULL -- reference to billing.invoice_id,\n appointment_id text -- reference to appointments.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp,\n notes char,\n exchange_rate character varying(256),\n reference_number varchar,\n balance bigint,\n customer_id character varying(128) -- identifier for customer,\n appointment_id text NOT NULL -- reference to appointments.customer_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(customer_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n last_login timestamp,\n age text,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n joined_at date,\n status varchar,\n last_login date NOT NULL,\n salt text,\n api_key char,\n first_name character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY created_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me user_id, approval_status, subtotal for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, subtotal FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, subtotal FROM tradingplatform.orders WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count user_id for each subtotal in orders?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(user_id) AS count_user_id FROM tradingplatform.orders GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve trades where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with card_type in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, exchange_rate, subtotal for every trade.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, exchange_rate, subtotal FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, exchange_rate, subtotal FROM tradingplatform.trades ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of trades grouped by delivery_status.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM tradingplatform.trades GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, cancelled_at, account_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, cancelled_at, account_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, cancelled_at, account_id FROM tradingplatform.orders WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me created_at, account_id, approval_status for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_id, approval_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_id, approval_status FROM tradingplatform.orders WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_id, approval_status FROM tradingplatform.orders WHERE created_at > '2023-12-01' ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY account_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "List created_at, approval_status, subtotal from orders.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, approval_status, subtotal FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, approval_status, subtotal FROM tradingplatform.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up orders by cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of trades across different approval_status values.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM tradingplatform.trades GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at date,\n subtotal integer,\n buyer_id varchar -- identifier for buyer,\n account_id varchar,\n currency text NOT NULL,\n approval_status character varying(64),\n user_id integer -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n approval_status character varying(256),\n card_type character varying(256),\n delivery_status varchar,\n currency varchar,\n subtotal numeric,\n exchange_rate character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.id,\n user_id integer NOT NULL -- reference to users.employee_id,\n FOREIGN KEY (order_id) REFERENCES orders(id),\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n is_active boolean -- indicates if active is true,\n is_verified boolean NOT NULL,\n password_hash varchar,\n last_login date NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the subtotal, created_at, processed_at of each trade?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, processed_at FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, processed_at FROM tradingplatform.trades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, processed_at FROM tradingplatform.trades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "What parent_id, media_url, media_url, keywords do we have for posts and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.media_url, messages.keywords FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.comment_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.media_url, messages.keywords FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.comment_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List published_at, message_id, like_id, media_url for each post along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.like_id, messages.media_url FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.comment_id;", "sql": null}, {"role": "user", "content": "Sort the results by score ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.like_id, messages.media_url FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.comment_id ORDER BY score ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "List parent_id, score, media_url from posts.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, score, media_url FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts where content_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, score, media_url FROM socialmedia.posts WHERE content_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many posts are there per message_id?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.posts GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get all posts between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "List content_id, attachment_url, media_url from posts.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, attachment_url, media_url FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match parent_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, attachment_url, media_url FROM socialmedia.posts WHERE parent_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by attachment_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, attachment_url, media_url FROM socialmedia.posts WHERE parent_id LIKE 'A%' ORDER BY attachment_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Get message_id, published_at, attachment_url from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, published_at, attachment_url FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by media_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, published_at, attachment_url FROM socialmedia.posts ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Group posts by parent_id and show the min of score.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, MIN(score) AS min_score FROM socialmedia.posts GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Get media_url, like_id, user_id from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, like_id, user_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Can you order these by like_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, like_id, user_id FROM socialmedia.messages ORDER BY like_id DESC;", "sql": null}, {"role": "user", "content": "What is the min updated_at for each categories in messages?", "sql": null}, {"role": "assistant", "content": "SELECT categories, MIN(updated_at) AS min_updated_at FROM socialmedia.messages GROUP BY categories;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "List published_at, message_id, parent_id from posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message_id, parent_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me content_id, parent_id, updated_at, tags from posts and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message_id, parent_id, messages.updated_at, messages.tags FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.comment_id;", "sql": null}, {"role": "user", "content": "Show me the count of posts grouped by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM socialmedia.posts GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id character varying(256) NOT NULL -- identifier for user,\n categories text,\n media_url character varying(256) NOT NULL,\n tags character varying(128) NOT NULL,\n keywords text,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n display_name text,\n avatar character varying(256),\n state char,\n website character varying(256),\n api_key character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n attachment_url character varying(128),\n media_url char,\n score char NOT NULL,\n message_id integer -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me categories, tags, media_url for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT categories, tags, media_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What user_id, tags, avatar, state do we have for messages and their associated likes?", "sql": null}, {"role": "assistant", "content": "SELECT categories, tags, media_url, likes.avatar, likes.state FROM socialmedia.messages JOIN socialmedia.likes ON messages.like_id = likes.id;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans that have employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE employee_id LIKE 'A%' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by city ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE last_login > '2023-01-01' ORDER BY city ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me age, payment_id, city for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT age, payment_id, city FROM finance.loans;", "sql": null}, {"role": "user", "content": "What last_login, age, product_id, user_id do we have for loans and their associated payments?", "sql": null}, {"role": "assistant", "content": "SELECT age, payment_id, city, payments.product_id, payments.user_id FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.order_id;", "sql": null}, {"role": "user", "content": "Calculate average of city for each payment_id in loans.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, AVERAGE(city) AS average_city FROM finance.loans GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "What are the payment_id, last_active, city of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, last_active, city FROM finance.loans;", "sql": null}, {"role": "user", "content": "List payment_id, employee_id, status, user_id for each loan along with their payment information.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, last_active, city, payments.status, payments.user_id FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.order_id;", "sql": null}, {"role": "user", "content": "Group loans by city and show the max of last_login.", "sql": null}, {"role": "assistant", "content": "SELECT city, MAX(last_login) AS max_last_login FROM finance.loans GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "List nationality, first_name, created_at from audits.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, first_name, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits from last week.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, first_name, created_at FROM finance.audits WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group audits by language and show the max of display_name.", "sql": null}, {"role": "assistant", "content": "SELECT language, MAX(display_name) AS max_display_name FROM finance.audits GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "List payment_id, display_name, joined_at from audits.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, display_name, joined_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve first_name, created_at, status, cancelled_at showing the relationship between audits and payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, display_name, joined_at, payments.status, payments.cancelled_at FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.order_id;", "sql": null}, {"role": "user", "content": "Can you order these by payment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, display_name, joined_at, payments.status, payments.cancelled_at FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.order_id ORDER BY payment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List last_active, city, exchange_rate, status for each loan along with their payment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.exchange_rate, payments.status FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.order_id;", "sql": null}, {"role": "user", "content": "Count the number of loans in each last_active category.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM finance.loans GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "List employee_id, last_active, city from loans.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, last_active, city FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me last_active, employee_id, completed_at, user_id from loans and their related payments.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, last_active, city, payments.completed_at, payments.user_id FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.order_id;", "sql": null}, {"role": "user", "content": "Sort the results by city descending.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, last_active, city, payments.completed_at, payments.user_id FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.order_id ORDER BY city DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY employee_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY employee_id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n address char,\n nationality varchar,\n display_name text,\n first_name character varying(256) NOT NULL,\n language character varying(128),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n last_login timestamp without time zone,\n age char NOT NULL,\n city character varying(256),\n payment_id text -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)\n\nCREATE TABLE finance.payments (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n status varchar,\n exchange_rate character varying(64),\n user_id character varying(64),\n product_id text NOT NULL -- identifier for product\n)", "conversations": [{"role": "user", "content": "What are the first_name, language, created_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, language, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by address ascending.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, language, created_at FROM finance.audits ORDER BY address ASC;", "sql": null}, {"role": "user", "content": "How many audits are there per nationality?", "sql": null}, {"role": "assistant", "content": "SELECT nationality, COUNT(*) AS count FROM finance.audits GROUP BY nationality ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders that have traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE traded_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at > '2023-12-01' ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Retrieve card_type, wallet_id, payment_method for every order.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, wallet_id, payment_method FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get metadat_id, payment_method, notes, created_at by joining orders with wallets.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, wallet_id, payment_method, wallets.notes, wallets.created_at FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.invoice_id;", "sql": null}, {"role": "user", "content": "How many orders are there per payment_method?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM tradingplatform.orders GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "What are the traded_at, wallet_id, payment_method of each order?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, wallet_id, payment_method FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by wallet_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, wallet_id, payment_method FROM tradingplatform.orders ORDER BY wallet_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, wallet_id, payment_method FROM tradingplatform.orders ORDER BY wallet_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Retrieve metadat_id, delivery_status, processed_at for every order.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, delivery_status, processed_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List card_type, payment_method, created_at, description for each order along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, delivery_status, processed_at, wallets.created_at, wallets.description FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.invoice_id;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, delivery_status, processed_at, wallets.created_at, wallets.description FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.invoice_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders that have wallet_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE wallet_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group orders by payment_method and show the max of card_type.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, MAX(card_type) AS max_card_type FROM tradingplatform.orders GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Group orders by processed_at and show the average of metadat_id.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, AVERAGE(metadat_id) AS average_metadat_id FROM tradingplatform.orders GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders that have processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n delivery_status char,\n payment_method character varying(128),\n card_type character varying(256),\n wallet_id text NOT NULL -- reference to wallets.invoice_id,\n metadat_id integer -- reference to metadata.item_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(item_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status character varying(64),\n notes char,\n description character varying(128) NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n item_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp,\n msrp varchar NOT NULL,\n name char,\n media_url text NOT NULL,\n price smallint,\n description character varying(64) NOT NULL,\n subcategory varchar\n)", "conversations": [{"role": "user", "content": "Show me card_type, payment_method, delivery_status for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, payment_method, delivery_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, payment_method, delivery_status FROM tradingplatform.orders ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Get average of payment_method by metadat_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, AVERAGE(payment_method) AS average_payment_method FROM tradingplatform.orders GROUP BY metadat_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE thumbnail_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE created_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail_url, comment_id, cost for every event.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, comment_id, cost FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, comment_id, cost FROM socialmedia.events WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up events by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.events GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "List backorder, created_at, cost from events.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, cost FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get created_at, backorder, views, published_at by joining events with comments.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, cost, comments.views, comments.published_at FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Get average of views by comment_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, AVERAGE(views) AS average_views FROM socialmedia.events GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by backorder descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY backorder DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "List views, comment_id, thumbnail_url from events.", "sql": null}, {"role": "assistant", "content": "SELECT views, comment_id, thumbnail_url FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve created_at, views, thumbnail, attachment_url showing the relationship between events and comments.", "sql": null}, {"role": "assistant", "content": "SELECT views, comment_id, thumbnail_url, comments.thumbnail, comments.attachment_url FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT views, comment_id, thumbnail_url, comments.thumbnail, comments.attachment_url FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me comment_id, thumbnail_url, user_id, views from events and their related comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.user_id, comments.views FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.user_id, comments.views FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE backorder LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail_url, comment_id, backorder for every event.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, comment_id, backorder FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Order the output by backorder ascending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, comment_id, backorder FROM socialmedia.events ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Get sum of cost by created_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(cost) AS sum_cost FROM socialmedia.events GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cost smallint,\n views character varying(128),\n backorder text,\n thumbnail_url character varying(64),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n attachment_url character varying(64),\n views character varying(256) NOT NULL,\n rating character varying(64),\n user_id character varying(256) -- identifier for user,\n thumbnail varchar\n)\n\nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp,\n popularity_score char,\n media_url text\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by views ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY views ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY views ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "List vendor_id, verification_status, transaction_id from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, verification_status, transaction_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Arrange the results with transaction_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, verification_status, transaction_id FROM tradingplatform.wallets ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Tally up wallets by payment_date.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY payment_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Get card_type, cancelled_at, traded_at from all trades.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, cancelled_at, traded_at FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, cancelled_at, traded_at FROM tradingplatform.trades WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up trades by payment_id.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM tradingplatform.trades GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Can you order these by payment_date ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY payment_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get all trades created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE cancelled_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate sum of user_id for each traded_at in trades.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, SUM(user_id) AS sum_user_id FROM tradingplatform.trades GROUP BY traded_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show the results sorted by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY card_type DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY card_type DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "List username, status, created_at from logs.", "sql": null}, {"role": "assistant", "content": "SELECT username, status, created_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT username, status, created_at FROM tradingplatform.logs WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT username, status, created_at FROM tradingplatform.logs WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with buyer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE traded_at > '2023-01-01' ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "List card_type, traded_at, payment_id from trades.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, traded_at, payment_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Arrange the results with cancelled_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, traded_at, payment_id FROM tradingplatform.trades ORDER BY cancelled_at DESC;", "sql": null}, {"role": "user", "content": "Count the number of trades in each cancelled_at category.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM tradingplatform.trades GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of trades across different traded_at values.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, COUNT(*) AS count FROM tradingplatform.trades GROUP BY traded_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp without time zone,\n user_id character varying(256) -- identifier for user,\n buyer_id character varying(64) -- identifier for buyer,\n card_type varchar\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n language character varying(128),\n username character varying(64) NOT NULL,\n status varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at timestamp,\n invoice_number character varying(128) NOT NULL,\n vendor_id character varying(128),\n verification_status character varying(128) NOT NULL,\n exchange_rate character varying(256),\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs that have username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of language for each username in logs.", "sql": null}, {"role": "assistant", "content": "SELECT username, SUM(language) AS sum_language FROM tradingplatform.logs GROUP BY username;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List created_at, user_id, payer_id from loans.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, payer_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get invoice_id, created_at, payee_id, created_at by joining loans with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, payer_id, accounts.payee_id, accounts.created_at FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, payer_id, accounts.payee_id, accounts.created_at FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "What payer_id, payee_id, reference_number, payment_date do we have for loans and their associated accounts?", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.reference_number, accounts.payment_date FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Tally up loans by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.loans GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where payer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE payer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE payer_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List invoice_id, account_id, verification_status, payee_id for each loan along with their account information.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.verification_status, accounts.payee_id FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Count the number of loans in each account_id category.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.loans GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me payer_id, verification_status, invoice_id for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, verification_status, invoice_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, verification_status, invoice_id FROM finance.loans WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of account_id grouped by payee_id for loans.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, MIN(account_id) AS min_account_id FROM finance.loans GROUP BY payee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve payee_id, created_at, payment_date, reference_number showing the relationship between loans and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.payment_date, accounts.reference_number FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "How many loans are there per invoice_id?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM finance.loans GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List payee_id, created_at, invoice_id from loans.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, created_at, invoice_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get all loans between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, created_at, invoice_id FROM finance.loans WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different verification_status values.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM finance.loans GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the payer_id, created_at, payee_id of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, created_at, payee_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, created_at, payee_id FROM finance.loans WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, created_at, payee_id FROM finance.loans WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List payer_id, verification_status, created_at from loans.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, verification_status, created_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, verification_status, created_at FROM finance.loans WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, verification_status, created_at FROM finance.loans WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n verification_status text,\n payer_id text,\n user_id character varying(256),\n payee_id character varying(256),\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n payee_id character varying(64),\n verification_status varchar,\n reference_number character varying(128)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n total integer,\n user_id varchar,\n currency text,\n tax decimal,\n approval_status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get user_id, account_id, invoice_id from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, account_id, invoice_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me invoice_id, payee_id, verification_status, reference_number from loans and their related accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, account_id, invoice_id, accounts.verification_status, accounts.reference_number FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "What is the average created_at for each payee_id in loans?", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, AVERAGE(created_at) AS average_created_at FROM finance.loans GROUP BY payee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM healthcare.departments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Retrieve nationality, id, last_active for every department.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, id, last_active FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, id, last_active FROM healthcare.departments ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "What is the count nationality for each last_active in departments?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(nationality) AS count_nationality FROM healthcare.departments GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by reconciliation_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY reconciliation_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Retrieve nationality, last_active, updated_at for every department.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, last_active, updated_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, last_active, updated_at FROM healthcare.departments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show the results sorted by birth_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, last_active, updated_at FROM healthcare.departments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY birth_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve prescriptions where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "How many departments are there per last_active?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM healthcare.departments GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "List updated_at, id, last_active from departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, id, last_active FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, id, last_active FROM healthcare.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, id, last_active FROM healthcare.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n reconciliation_status character varying(256),\n debit varchar,\n description char,\n invoice_number text\n)\n\nCREATE TABLE healthcare.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active date,\n website character varying(256) NOT NULL,\n nationality char,\n birth_date date\n)", "conversations": [{"role": "user", "content": "Get updated_at, id, website from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, id, website FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, id, website FROM healthcare.departments WHERE birth_date BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get min of nationality by id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(nationality) AS min_nationality FROM healthcare.departments GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp,\n email character varying(256),\n zip_code char,\n account_status character varying(128) NOT NULL,\n country char NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.item_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(item_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares char,\n content char,\n media_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n tags text\n)\n\nCREATE TABLE healthcare.appointments (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n description text,\n media_url text NOT NULL,\n backorder varchar,\n video_url character varying(128),\n price smallint,\n rating character varying(128),\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n video_url varchar,\n stock_level character varying(64) NOT NULL,\n category char NOT NULL,\n prescription_id text NOT NULL -- reference to prescriptions.comment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(comment_id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate min of video_url for each rating in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, MIN(video_url) AS min_video_url FROM healthcare.appointments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp,\n email character varying(256),\n zip_code char,\n account_status character varying(128) NOT NULL,\n country char NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.item_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(item_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares char,\n content char,\n media_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n tags text\n)\n\nCREATE TABLE healthcare.appointments (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n description text,\n media_url text NOT NULL,\n backorder varchar,\n video_url character varying(128),\n price smallint,\n rating character varying(128),\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n video_url varchar,\n stock_level character varying(64) NOT NULL,\n category char NOT NULL,\n prescription_id text NOT NULL -- reference to prescriptions.comment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Order the output by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY stock_level ASC;", "sql": null}, {"role": "user", "content": "Show me the count of medical_records grouped by prescription_id.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, COUNT(*) AS count FROM healthcare.medical_records GROUP BY prescription_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp,\n email character varying(256),\n zip_code char,\n account_status character varying(128) NOT NULL,\n country char NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.item_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(item_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares char,\n content char,\n media_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n tags text\n)\n\nCREATE TABLE healthcare.appointments (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp,\n description text,\n media_url text NOT NULL,\n backorder varchar,\n video_url character varying(128),\n price smallint,\n rating character varying(128),\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n video_url varchar,\n stock_level character varying(64) NOT NULL,\n category char NOT NULL,\n prescription_id text NOT NULL -- reference to prescriptions.comment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by stock_level descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY stock_level DESC;", "sql": null}, {"role": "user", "content": "Can you order these by prescription_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY prescription_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders;", "sql": null}, {"role": "user", "content": "Can you order these by fee ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders ORDER BY fee ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders ORDER BY fee ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders;", "sql": null}, {"role": "user", "content": "Get orders that match user_id > 42.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders WHERE user_id > 42;", "sql": null}, {"role": "user", "content": "Group orders by approval_status and show the count of cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(cancelled_at) AS count_cancelled_at FROM insurance.orders GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, address_id, user_id from all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, address_id, user_id FROM insurance.facilities;", "sql": null}, {"role": "user", "content": "List facilities that have address_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, address_id, user_id FROM insurance.facilities WHERE address_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of location_lon for each street in facilities.", "sql": null}, {"role": "assistant", "content": "SELECT street, MIN(location_lon) AS min_location_lon FROM insurance.facilities GROUP BY street;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the cancelled_at, user_id, subtotal of each order?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, user_id, subtotal FROM insurance.orders;", "sql": null}, {"role": "user", "content": "List cancelled_at, user_id, language, created_at for each order along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, user_id, subtotal, users.language, users.created_at FROM insurance.orders JOIN insurance.users ON orders.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, user_id, subtotal, users.language, users.created_at FROM insurance.orders JOIN insurance.users ON orders.user_id = users.customer_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List user_id, street, address_id from facilities.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, street, address_id FROM insurance.facilities;", "sql": null}, {"role": "user", "content": "Show me address_id, last_inspected, language, joined_at from facilities and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, street, address_id, users.language, users.joined_at FROM insurance.facilities JOIN insurance.users ON facilities.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, street, address_id, users.language, users.joined_at FROM insurance.facilities JOIN insurance.users ON facilities.user_id = users.customer_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.facilities;", "sql": null}, {"role": "user", "content": "Find facilities created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.facilities WHERE last_inspected > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.facilities WHERE last_inspected > '2023-12-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List fee, approval_status, subtotal from orders.", "sql": null}, {"role": "assistant", "content": "SELECT fee, approval_status, subtotal FROM insurance.orders;", "sql": null}, {"role": "user", "content": "Show me subtotal, user_id, created_at, joined_at from orders and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT fee, approval_status, subtotal, users.created_at, users.joined_at FROM insurance.orders JOIN insurance.users ON orders.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Count the number of orders in each cancelled_at category.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM insurance.orders GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me address_id, street, last_inspected for all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, street, last_inspected FROM insurance.facilities;", "sql": null}, {"role": "user", "content": "What last_inspected, coordinates, joined_at, timezone do we have for facilities and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT address_id, street, last_inspected, users.joined_at, users.timezone FROM insurance.facilities JOIN insurance.users ON facilities.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "How many facilities are there per street?", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM insurance.facilities GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, last_inspected, location_lon for every facilitie.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, last_inspected, location_lon FROM insurance.facilities;", "sql": null}, {"role": "user", "content": "Get location_lon, operating_hours, phone, created_at by joining facilities with users.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, last_inspected, location_lon, users.phone, users.created_at FROM insurance.facilities JOIN insurance.users ON facilities.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Show me the count of facilities grouped by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM insurance.facilities GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.orders (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n approval_status character varying(64),\n fee varchar,\n subtotal bigint NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE insurance.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n timezone char NOT NULL,\n language character varying(64),\n phone text NOT NULL\n)\n\nCREATE TABLE insurance.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n coordinates text NOT NULL,\n location_lon character varying(128),\n street char NOT NULL,\n operating_hours character varying(256),\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.orders;", "sql": null}, {"role": "user", "content": "Get user_id, subtotal, phone, timezone by joining orders with users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.phone, users.timezone FROM insurance.orders JOIN insurance.users ON orders.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.phone, users.timezone FROM insurance.orders JOIN insurance.users ON orders.user_id = users.customer_id ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Show me customer_id, invoice_id, processed_at for all events.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, invoice_id, processed_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get all events modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, invoice_id, processed_at FROM socialmedia.events WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of events in each customer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM socialmedia.events GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve fee, approval_status, subtotal for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT fee, approval_status, subtotal FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT fee, approval_status, subtotal FROM socialmedia.followers WHERE completed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different subtotal values.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM socialmedia.followers GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Get customer_id, vendor_id, processed_at from all events.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, vendor_id, processed_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, vendor_id, processed_at FROM socialmedia.events WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the count balance for each customer_id in events?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(balance) AS count_balance FROM socialmedia.events GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What approval_status, comment_id, visibility, edited_at do we have for followers and their associated comments?", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.visibility, comments.edited_at FROM socialmedia.followers JOIN socialmedia.comments ON followers.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Show me the count of followers grouped by card_type.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM socialmedia.followers GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve comment_id, card_type, edited_at, image_url showing the relationship between followers and comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.edited_at, comments.image_url FROM socialmedia.followers JOIN socialmedia.comments ON followers.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.edited_at, comments.image_url FROM socialmedia.followers JOIN socialmedia.comments ON followers.comment_id = comments.message_id ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where balance > 13.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE balance > 13;", "sql": null}, {"role": "user", "content": "Group events by approval_status and show the max of vendor_id.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MAX(vendor_id) AS max_vendor_id FROM socialmedia.events GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with comment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE comment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE comment_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY processed_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by balance ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY balance ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Arrange the results with comment_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY comment_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of events across different vendor_id values.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM socialmedia.events GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status varchar,\n customer_id character varying(64) -- identifier for customer,\n vendor_id text -- identifier for vendor,\n balance decimal,\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.followers (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n fee varchar,\n payment_status char,\n subtotal smallint,\n approval_status varchar,\n card_type text NOT NULL,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n likes text NOT NULL,\n visibility character varying(64),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "List balance, customer_id, vendor_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT balance, customer_id, vendor_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get processed_at, vendor_id, likes, image_url by joining events with comments.", "sql": null}, {"role": "assistant", "content": "SELECT balance, customer_id, vendor_id, comments.likes, comments.image_url FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Order the output by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT balance, customer_id, vendor_id, comments.likes, comments.image_url FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.message_id ORDER BY comment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "List created_at, id, total, completed_at for each addresse along with their purchase information.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.total, purchases.completed_at FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Group addresses by id and show the min of id.", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(id) AS min_id FROM inventory.addresses GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the description, purchase_id, id of each addresse?", "sql": null}, {"role": "assistant", "content": "SELECT description, purchase_id, id FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "List description, last_inspected, tax, completed_at for each addresse along with their purchase information.", "sql": null}, {"role": "assistant", "content": "SELECT description, purchase_id, id, purchases.tax, purchases.completed_at FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "What is the average purchase_id for each purchase_id in addresses?", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, AVERAGE(purchase_id) AS average_purchase_id FROM inventory.addresses GROUP BY purchase_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get created_at, parking_available, description from all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parking_available, description FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Retrieve addresses where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parking_available, description FROM inventory.addresses WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Sort the results by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parking_available, description FROM inventory.addresses WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Get last_inspected, created_at, completed_at, tax by joining addresses with purchases.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.completed_at, purchases.tax FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.completed_at, purchases.tax FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Arrange the results with purchase_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY purchase_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Sort the results by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY description ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Get created_at, purchase_id, tax, completed_at by joining addresses with purchases.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.tax, purchases.completed_at FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.tax, purchases.completed_at FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve description, category, id for every addresse.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, id FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, id FROM inventory.addresses WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group addresses by id and show the average of parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT id, AVERAGE(parking_available) AS average_parking_available FROM inventory.addresses GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.purchases (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n created_at timestamp without time zone,\n tax numeric,\n total bigint NOT NULL,\n customer_id character varying(256) -- identifier for customer,\n exchange_rate character varying(128)\n)\n\nCREATE TABLE inventory.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at timestamp,\n description char,\n parking_available text,\n category character varying(128) NOT NULL,\n purchase_id integer NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "List purchase_id, id, total, exchange_rate for each addresse along with their purchase information.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.total, purchases.exchange_rate FROM inventory.addresses JOIN inventory.purchases ON addresses.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Count the number of addresses in each last_inspected category.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM inventory.addresses GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me count of balance grouped by payment_date for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, COUNT(balance) AS count_balance FROM finance.accounts GROUP BY payment_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have balance > 50.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE balance > 50;", "sql": null}, {"role": "user", "content": "Show me sum of balance grouped by payment_date for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, SUM(balance) AS sum_balance FROM finance.accounts GROUP BY payment_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Get audit_id, description, category from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, category FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List description, category, created_at, keywords for each account along with their audit information.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, category, audits.created_at, audits.keywords FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id;", "sql": null}, {"role": "user", "content": "Tally up accounts by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM finance.accounts GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Show me balance, account_id, description for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT balance, account_id, description FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT balance, account_id, description FROM finance.accounts WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group accounts by balance and show the count of audit_id.", "sql": null}, {"role": "assistant", "content": "SELECT balance, COUNT(audit_id) AS count_audit_id FROM finance.accounts GROUP BY balance;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY payment_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve account_id, payment_date, views, keywords showing the relationship between accounts and audits.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.views, audits.keywords FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id;", "sql": null}, {"role": "user", "content": "Sort the results by payment_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.views, audits.keywords FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id ORDER BY payment_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by balance ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days' ORDER BY balance ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve category, audit_id, keywords, rating showing the relationship between accounts and audits.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.keywords, audits.rating FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.keywords, audits.rating FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "List audit_id, description, invoice_number from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, invoice_number FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Order the output by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, invoice_number FROM finance.accounts ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of accounts in each payment_date category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, COUNT(*) AS count FROM finance.accounts GROUP BY payment_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords character varying(64),\n views character varying(128),\n image_url char,\n rating varchar\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n balance bigint,\n description char,\n category text NOT NULL,\n invoice_number character varying(256),\n audit_id text NOT NULL -- reference to audits.message_id,\n FOREIGN KEY (audit_id) REFERENCES audits(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_number, category, balance for every account.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, balance FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me account_id, balance, views, rating from accounts and their related audits.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, balance, audits.views, audits.rating FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, balance, audits.views, audits.rating FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.message_id ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where medical_record_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE medical_record_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different quantity values.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM healthcare.appointments GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have department_id > 82.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE department_id > 82;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE department_id > 82 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List video_url, department_id, address_line2, last_inspected for each appointment along with their medical_record information.", "sql": null}, {"role": "assistant", "content": "SELECT *, medical_records.address_line2, medical_records.last_inspected FROM healthcare.appointments JOIN healthcare.medical_records ON appointments.medical_record_id = medical_records.venue_id;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, medical_records.address_line2, medical_records.last_inspected FROM healthcare.appointments JOIN healthcare.medical_records ON appointments.medical_record_id = medical_records.venue_id ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "List all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by medical_record_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE quantity LIKE 'A%' ORDER BY medical_record_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Arrange the results with department_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY department_id ASC;", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by quantity for appointments.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, MAX(created_at) AS max_created_at FROM healthcare.appointments GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Arrange the results with medical_record_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY medical_record_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of appointments in each video_url category.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, COUNT(*) AS count FROM healthcare.appointments GROUP BY video_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get sum of medical_record_id by video_url from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, SUM(medical_record_id) AS sum_medical_record_id FROM healthcare.appointments GROUP BY video_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Order the output by video_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY video_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where medical_record_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE medical_record_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of quantity for each thumbnail_url in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(quantity) AS count_quantity FROM healthcare.appointments GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n video_url character varying(64),\n image_url character varying(64),\n quantity character varying(64),\n thumbnail_url character varying(256),\n medical_record_id text -- reference to medical_records.venue_id,\n department_id integer NOT NULL -- reference to departments.person_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(venue_id),\n FOREIGN KEY (department_id) REFERENCES departments(person_id)\n)\n\nCREATE TABLE healthcare.departments (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n is_verified boolean NOT NULL,\n api_key varchar,\n email varchar,\n birth_date timestamp without time zone,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category character varying(128),\n address_line2 char,\n coordinates character varying(64),\n parking_available text\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have price > 19.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE price > 19;", "sql": null}, {"role": "user", "content": "Get average of traded_at by approval_status from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, AVERAGE(traded_at) AS average_traded_at FROM tradingplatform.metadata GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "What fee, processed_at, tax_rate, currency do we have for metadata and their associated assets?", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.tax_rate, assets.currency FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.tax_rate, assets.currency FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List asset_id, price, fee from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, price, fee FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me processed_at, price, created_at, price from metadata and their related assets.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, price, fee, assets.created_at, assets.price FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.id;", "sql": null}, {"role": "user", "content": "Order the output by asset_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, price, fee, assets.created_at, assets.price FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.id ORDER BY asset_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE processed_at > '2023-01-01' ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE approval_status LIKE 'A%' ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get all metadata created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE traded_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Retrieve metadata where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by price descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY price DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve price, processed_at, fee for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, fee FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get processed_at, price, price, tax_rate by joining metadata with assets.", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, fee, assets.price, assets.tax_rate FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.id;", "sql": null}, {"role": "user", "content": "Count the number of metadata in each asset_id category.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY asset_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n product_id char NOT NULL -- identifier for product,\n exchange_rate character varying(128),\n metadat_id text NOT NULL -- reference to metadata.order_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(order_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price smallint,\n tax_rate character varying(128),\n reserved character varying(256),\n currency varchar\n)\n\nCREATE TABLE tradingplatform.metadata (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n traded_at date,\n fee char,\n price numeric(38,14),\n approval_status text,\n asset_id integer NOT NULL -- reference to assets.id,\n FOREIGN KEY (asset_id) REFERENCES assets(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n approval_status character varying(64),\n buyer_id char -- identifier for buyer,\n payment_method character varying(64) NOT NULL,\n card_type varchar,\n customer_id character varying(64),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE traded_at > '2023-01-01' ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, video_url, price for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, video_url, price FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, video_url, price FROM education.enrollments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, video_url, price FROM education.enrollments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments with reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of updated_at by updated_at from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(updated_at) AS max_updated_at FROM education.enrollments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve product_id, video_url, updated_at for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, video_url, updated_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, video_url, updated_at FROM education.enrollments WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each video_url category.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, COUNT(*) AS count FROM education.enrollments GROUP BY video_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Order the output by reserved ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY reserved ASC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, reserved, featured_rank from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, reserved, featured_rank FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments with reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, reserved, featured_rank FROM education.enrollments WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, reserved, featured_rank FROM education.enrollments WHERE reserved LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "What reserved, updated_at, popularity_score, backorder do we have for enrollments and their associated departments?", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.popularity_score, departments.backorder FROM education.enrollments JOIN education.departments ON enrollments.department_id = departments.product_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.popularity_score, departments.backorder FROM education.enrollments JOIN education.departments ON enrollments.department_id = departments.product_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me max of video_url grouped by department_id for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MAX(video_url) AS max_video_url FROM education.enrollments GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "What are the published_at, product_id, featured_rank of each enrollment?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, product_id, featured_rank FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match price > 71.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, product_id, featured_rank FROM education.enrollments WHERE price > 71;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, product_id, featured_rank FROM education.enrollments WHERE price > 71 LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Arrange the results with department_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY department_id ASC;", "sql": null}, {"role": "user", "content": "Calculate average of updated_at for each updated_at in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(updated_at) AS average_updated_at FROM education.enrollments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved character varying(128),\n thumbnail_url varchar NOT NULL,\n subcategory varchar,\n msrp character varying(256),\n popularity_score character varying(128) NOT NULL,\n backorder character varying(256)\n)\n\nCREATE TABLE education.teachers (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n available character varying(256) NOT NULL,\n subcategory character varying(64),\n video_url text -- identifier for video_url,\n image_url character varying(128) NOT NULL,\n thumbnail_url character varying(128) NOT NULL,\n price bigint NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n reserved character varying(128),\n featured_rank char,\n price numeric,\n video_url character varying(256) -- identifier for video_url,\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments that have department_id > 53.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE department_id > 53;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE department_id > 53 LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "What body, image_url, payment_method, exchange_rate do we have for comments and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.payment_method, groups.exchange_rate FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Can you order these by body descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.payment_method, groups.exchange_rate FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.payment_id ORDER BY body DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me shares, post_id, created_at for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT shares, post_id, created_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where post_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT shares, post_id, created_at FROM socialmedia.comments WHERE post_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of likes for each image_url in comments.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MIN(likes) AS min_likes FROM socialmedia.comments GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve likes, post_id, body for every comment.", "sql": null}, {"role": "assistant", "content": "SELECT likes, post_id, body FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Sort the results by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT likes, post_id, body FROM socialmedia.comments ORDER BY post_id ASC;", "sql": null}, {"role": "user", "content": "What is the sum likes for each likes in comments?", "sql": null}, {"role": "assistant", "content": "SELECT likes, SUM(likes) AS sum_likes FROM socialmedia.comments GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve post_id, created_at, shares for every comment.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, shares FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, shares FROM socialmedia.comments WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum post_id for each shares in comments?", "sql": null}, {"role": "assistant", "content": "SELECT shares, SUM(post_id) AS sum_post_id FROM socialmedia.comments GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "List likes, group_id, body from comments.", "sql": null}, {"role": "assistant", "content": "SELECT likes, group_id, body FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT likes, group_id, body FROM socialmedia.comments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get count of group_id by group_id from comments.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(group_id) AS count_group_id FROM socialmedia.comments GROUP BY group_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Can you order these by group_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY group_id ASC;", "sql": null}, {"role": "user", "content": "How many comments are there per shares?", "sql": null}, {"role": "assistant", "content": "SELECT shares, COUNT(*) AS count FROM socialmedia.comments GROUP BY shares ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List published_at, body, created_at, payment_status for each comment along with their group information.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.created_at, groups.payment_status FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Arrange the results with image_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.created_at, groups.payment_status FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.payment_id ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Get group_id, created_at, published_at from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, created_at, published_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments that have group_id > 86.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, created_at, published_at FROM socialmedia.comments WHERE group_id > 86;", "sql": null}, {"role": "user", "content": "Sort the results by image_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, created_at, published_at FROM socialmedia.comments WHERE group_id > 86 ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the categories, post_id, body of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT categories, post_id, body FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT categories, post_id, body FROM socialmedia.comments WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the average likes for each post_id in comments?", "sql": null}, {"role": "assistant", "content": "SELECT post_id, AVERAGE(likes) AS average_likes FROM socialmedia.comments GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n traded_at date,\n account_id text,\n payment_method character varying(128),\n exchange_rate character varying(64) NOT NULL,\n subtotal integer,\n payment_status character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n likes character varying(64),\n shares char,\n categories varchar,\n image_url character varying(128),\n body character varying(64),\n group_id integer NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get shares, created_at, account_id, subtotal by joining comments with groups.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.account_id, groups.subtotal FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Tally up comments by likes.", "sql": null}, {"role": "assistant", "content": "SELECT likes, COUNT(*) AS count FROM socialmedia.comments GROUP BY likes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve is_verified, full_name, store_id for every member.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, full_name, store_id FROM travel.members;", "sql": null}, {"role": "user", "content": "Retrieve address, is_verified, member_id, latitude showing the relationship between members and stores.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, full_name, store_id, stores.member_id, stores.latitude FROM travel.members JOIN travel.stores ON members.store_id = stores.store_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, full_name, store_id, stores.member_id, stores.latitude FROM travel.members JOIN travel.stores ON members.store_id = stores.store_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "List full_name, updated_at, store_id from members.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, store_id FROM travel.members;", "sql": null}, {"role": "user", "content": "Show me members with full_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, store_id FROM travel.members WHERE full_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, store_id FROM travel.members WHERE full_name LIKE 'A%' ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.sales;", "sql": null}, {"role": "user", "content": "What order_id, exchange_rate, updated_at, latitude do we have for sales and their associated stores?", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.updated_at, stores.latitude FROM travel.sales JOIN travel.stores ON sales.store_id = stores.store_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.updated_at, stores.latitude FROM travel.sales JOIN travel.stores ON sales.store_id = stores.store_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve address, account_status, full_name for every member.", "sql": null}, {"role": "assistant", "content": "SELECT address, account_status, full_name FROM travel.members;", "sql": null}, {"role": "user", "content": "List members that have is_verified = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT address, account_status, full_name FROM travel.members WHERE is_verified = TRUE;", "sql": null}, {"role": "user", "content": "Show me the count of members grouped by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM travel.members GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.stores;", "sql": null}, {"role": "user", "content": "List stores that have name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.stores WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up stores by latitude.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, COUNT(*) AS count FROM travel.stores GROUP BY latitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.sales;", "sql": null}, {"role": "user", "content": "Show me order_id, product_id, name, updated_at from sales and their related stores.", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.name, stores.updated_at FROM travel.sales JOIN travel.stores ON sales.store_id = stores.store_id;", "sql": null}, {"role": "user", "content": "How many sales are there per exchange_rate?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM travel.sales GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.stores;", "sql": null}, {"role": "user", "content": "Show me stores that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.stores WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group stores by name and show the average of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT name, AVERAGE(updated_at) AS average_updated_at FROM travel.stores GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, product_id, updated_at for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, product_id, updated_at FROM travel.sales;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, product_id, updated_at FROM travel.sales ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of sales in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM travel.sales GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, product_id, subtotal for all sales.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, product_id, subtotal FROM travel.sales;", "sql": null}, {"role": "user", "content": "Show me sales with exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, product_id, subtotal FROM travel.sales WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, product_id, subtotal FROM travel.sales WHERE exchange_rate LIKE 'A%' ORDER BY subtotal DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.members (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n account_status text,\n is_verified boolean,\n full_name character varying(64) NOT NULL,\n address character varying(64),\n store_id text -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.sales (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n processed_at date,\n exchange_rate character varying(64) NOT NULL,\n subtotal integer NOT NULL,\n product_id character varying(64),\n store_id text NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE travel.stores (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n latitude char NOT NULL,\n name varchar,\n postal_code character varying(256),\n member_id text NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.members;", "sql": null}, {"role": "user", "content": "Find members older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.members WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of members in each address category.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM travel.members GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Can you order these by website descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY website DESC;", "sql": null}, {"role": "user", "content": "Order the output by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get orders that match discount > 33.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE discount > 33;", "sql": null}, {"role": "user", "content": "Calculate max of created_at for each user_id in orders.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MAX(created_at) AS max_created_at FROM tradingplatform.orders GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "List website, password_hash, country from users.", "sql": null}, {"role": "assistant", "content": "SELECT website, password_hash, country FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match asset_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT website, password_hash, country FROM tradingplatform.users WHERE asset_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group users by display_name and show the min of address.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, MIN(address) AS min_address FROM tradingplatform.users GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by order_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Get min of updated_at by discount from assets.", "sql": null}, {"role": "assistant", "content": "SELECT discount, MIN(updated_at) AS min_updated_at FROM tradingplatform.assets GROUP BY discount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get all assets from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different stock_level values.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, COUNT(*) AS count FROM tradingplatform.assets GROUP BY stock_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many orders are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different display_name values.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me stock_level, order_id, updated_at for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, order_id, updated_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Arrange the results with stock_level in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, order_id, updated_at FROM tradingplatform.assets ORDER BY stock_level ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, order_id, updated_at FROM tradingplatform.assets ORDER BY stock_level ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n password_hash character varying(256) NOT NULL,\n country character varying(128) NOT NULL,\n website character varying(256),\n address char,\n display_name character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n currency character varying(128) NOT NULL,\n amount numeric,\n exchange_rate char,\n discount integer,\n total numeric NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n thumbnail_url character varying(256),\n stock_level character varying(256),\n discount numeric,\n order_id integer -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get discount, order_id, stock_level from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT discount, order_id, stock_level FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List assets that have discount > 79.", "sql": null}, {"role": "assistant", "content": "SELECT discount, order_id, stock_level FROM tradingplatform.assets WHERE discount > 79;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT discount, order_id, stock_level FROM tradingplatform.assets WHERE discount > 79 ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get card_type, product_id, updated_at, backorder by joining orders with assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.updated_at, assets.backorder FROM tradingplatform.orders JOIN tradingplatform.assets ON orders.asset_id = assets.product_id;", "sql": null}, {"role": "user", "content": "Arrange the results with delivery_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.updated_at, assets.backorder FROM tradingplatform.orders JOIN tradingplatform.assets ON orders.asset_id = assets.product_id ORDER BY delivery_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by delivery_status.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM tradingplatform.orders GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me media_url, stock_level, card_type, updated_at from assets and their related orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.card_type, orders.updated_at FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "How many assets are there per price?", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM tradingplatform.assets GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, popularity_score, published_at from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, published_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets with backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, published_at FROM tradingplatform.assets WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, published_at FROM tradingplatform.assets WHERE backorder LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Group orders by card_type and show the count of quantity.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(quantity) AS count_quantity FROM tradingplatform.orders GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE created_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "List thumbnail_url, available, published_at from assets.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, available, published_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, available, published_at FROM tradingplatform.assets WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group assets by published_at and show the sum of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, SUM(published_at) AS sum_published_at FROM tradingplatform.assets GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "What are the backorder, thumbnail_url, updated_at of each asset?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, thumbnail_url, updated_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get order_id, media_url, updated_at, asset_id by joining assets with orders.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, thumbnail_url, updated_at, orders.updated_at, orders.asset_id FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Group assets by media_url and show the average of order_id.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, AVERAGE(order_id) AS average_order_id FROM tradingplatform.assets GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, approval_status, delivery_status from orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, delivery_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, delivery_status FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, delivery_status FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n price integer,\n available character varying(64),\n popularity_score text,\n backorder varchar,\n stock_level char,\n thumbnail_url varchar NOT NULL,\n media_url char,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n approval_status character varying(128),\n delivery_status character varying(256),\n card_type character varying(256) NOT NULL,\n product_id character varying(256) NOT NULL,\n quantity char NOT NULL,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)", "conversations": [{"role": "user", "content": "Show me backorder, price, available for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, price, available FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me popularity_score, thumbnail_url, quantity, delivery_status from assets and their related orders.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, price, available, orders.quantity, orders.delivery_status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Arrange the results with price in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, price, available, orders.quantity, orders.delivery_status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id ORDER BY price DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Get customer_id, status, seller_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, status, seller_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, status, seller_id FROM finance.payments ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "Get sum of updated_at by payment_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, SUM(updated_at) AS sum_updated_at FROM finance.payments GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "What are the payment_method, processed_at, payment_id of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, processed_at, payment_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Arrange the results with status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, processed_at, payment_id FROM finance.payments ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Count the number of payments in each processed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.payments GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve status, subtotal, last_active, last_login showing the relationship between payments and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_active, customers.last_login FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Group payments by updated_at and show the min of payment_id.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(payment_id) AS min_payment_id FROM finance.payments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "What updated_at, processed_at, membership_level, last_login do we have for payments and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.membership_level, customers.last_login FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different payment_status values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.payments GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, seller_id, customer_id for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, customer_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Arrange the results with seller_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, customer_id FROM finance.payments ORDER BY seller_id DESC;", "sql": null}, {"role": "user", "content": "Calculate min of updated_at for each payment_method in payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, MIN(updated_at) AS min_updated_at FROM finance.payments GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Get payment_method, subtotal, payment_status from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, payment_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, payment_status FROM finance.payments WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, payment_status FROM finance.payments WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by payment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY payment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "List customer_id, updated_at, payment_status from payments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, payment_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, payment_status FROM finance.payments ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of payments in each status category.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM finance.payments GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.payments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payment_status text,\n status text,\n subtotal numeric(38,14),\n seller_id character varying(64) -- identifier for seller,\n payment_method varchar,\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n exchange_rate char NOT NULL,\n balance integer NOT NULL,\n description text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp,\n age text,\n display_name text,\n membership_level text NOT NULL,\n profile_picture_url character varying(128),\n last_login timestamp\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Group payments by subtotal and show the min of seller_id.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, MIN(seller_id) AS min_seller_id FROM finance.payments GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get count of city by membership_level from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, COUNT(city) AS count_city FROM healthcare.doctors GROUP BY membership_level;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get last_active, email, joined_at from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, email, joined_at FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "What profile_picture_url, city, author_id, doctor_id do we have for doctors and their associated departments?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, email, joined_at, departments.author_id, departments.doctor_id FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Show me the count of doctors grouped by email.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM healthcare.doctors GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_active, password_hash, profile_picture_url for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, password_hash, profile_picture_url FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve last_active, profile_picture_url, media_url, subject showing the relationship between doctors and departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, password_hash, profile_picture_url, departments.media_url, departments.subject FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, password_hash, profile_picture_url, departments.media_url, departments.subject FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get email, last_active, password_hash from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT email, last_active, password_hash FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT email, last_active, password_hash FROM healthcare.doctors WHERE last_active <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT email, last_active, password_hash FROM healthcare.doctors WHERE last_active <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with password_hash in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY password_hash ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY password_hash ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_active, joined_at, password_hash for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, password_hash FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, password_hash FROM healthcare.doctors WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, password_hash FROM healthcare.doctors WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with doctor_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY doctor_id DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with text in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY text ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get doctor_id, views, department_id, profile_picture_url by joining departments with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.department_id, doctors.profile_picture_url FROM healthcare.departments JOIN healthcare.doctors ON departments.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "What is the sum author_id for each text in departments?", "sql": null}, {"role": "assistant", "content": "SELECT text, SUM(author_id) AS sum_author_id FROM healthcare.departments GROUP BY text;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Show me edited_at, doctor_id, text for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, doctor_id, text FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Sort the results by text descending.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, doctor_id, text FROM healthcare.departments ORDER BY text DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, doctor_id, text FROM healthcare.departments ORDER BY text DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city character varying(256),\n email text,\n membership_level character varying(64) NOT NULL,\n password_hash char,\n profile_picture_url text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n parent_id character varying(128),\n views character varying(128),\n text character varying(256),\n subject varchar NOT NULL,\n media_url character varying(256),\n author_id character varying(128) NOT NULL,\n thumbnail character varying(256) NOT NULL,\n doctor_id text -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List city, department_id, doctor_id, edited_at for each doctor along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.doctor_id, departments.edited_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Show me sum of profile_picture_url grouped by email for doctors.", "sql": null}, {"role": "assistant", "content": "SELECT email, SUM(profile_picture_url) AS sum_profile_picture_url FROM healthcare.doctors GROUP BY email;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Get payment_method, cancelled_at, created_at from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, cancelled_at, created_at FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, cancelled_at, created_at FROM education.grades WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate min of delivery_status for each delivery_status in grades.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, MIN(delivery_status) AS min_delivery_status FROM education.grades GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me cancelled_at, amount, payment_method for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, amount, payment_method FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, amount, payment_method FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Sort the results by cancelled_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, amount, payment_method FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY cancelled_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Order the output by shares descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY shares DESC;", "sql": null}, {"role": "user", "content": "Count the number of assignments in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.assignments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show me sum of image_url grouped by shares for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT shares, SUM(image_url) AS sum_image_url FROM education.assignments GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the category, currency, created_at of each department?", "sql": null}, {"role": "assistant", "content": "SELECT category, currency, created_at FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, currency, created_at FROM education.departments ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different currency values.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM education.departments GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by likes descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY likes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with cancelled_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY cancelled_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments that have text LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE text LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE text LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n delivery_status text,\n amount decimal NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE education.departments (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category varchar NOT NULL,\n currency character varying(64)\n)\n\nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n shares character varying(64),\n categories varchar,\n image_url character varying(256),\n text character varying(128) NOT NULL,\n likes character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of assignments in each likes category.", "sql": null}, {"role": "assistant", "content": "SELECT likes, COUNT(*) AS count FROM education.assignments GROUP BY likes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "What are the stock_level, manufacturer, quantity of each product?", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, manufacturer, quantity FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products from last week.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, manufacturer, quantity FROM e-commerce.products WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by quantity ascending?", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, manufacturer, quantity FROM e-commerce.products WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY quantity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "Get amount, credit, reconciliation_status from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT amount, credit, reconciliation_status FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get credit, created_at, stock_level, categorie_id by joining categories with products.", "sql": null}, {"role": "assistant", "content": "SELECT amount, credit, reconciliation_status, products.stock_level, products.categorie_id FROM e-commerce.categories JOIN e-commerce.products ON categories.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by credit for categories.", "sql": null}, {"role": "assistant", "content": "SELECT credit, MAX(created_at) AS max_created_at FROM e-commerce.categories GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What quantity, expires_at, reconciliation_status, payer_id do we have for products and their associated categories?", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.reconciliation_status, categories.payer_id FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.account_id;", "sql": null}, {"role": "user", "content": "Calculate max of categorie_id for each quantity in products.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, MAX(categorie_id) AS max_categorie_id FROM e-commerce.products GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "Show me available, stock_level, expires_at for all products.", "sql": null}, {"role": "assistant", "content": "SELECT available, stock_level, expires_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT available, stock_level, expires_at FROM e-commerce.products WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT available, stock_level, expires_at FROM e-commerce.products WHERE stock_level LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What expires_at, quantity, amount, reconciliation_status do we have for products and their associated categories?", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.amount, categories.reconciliation_status FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.account_id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.amount, categories.reconciliation_status FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.account_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group categories by created_at and show the count of reconciliation_status.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(reconciliation_status) AS count_reconciliation_status FROM e-commerce.categories GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me verification_status, amount, stock_level, manufacturer from categories and their related products.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.stock_level, products.manufacturer FROM e-commerce.categories JOIN e-commerce.products ON categories.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Group categories by verification_status and show the average of credit.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, AVERAGE(credit) AS average_credit FROM e-commerce.categories GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Find categories created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Order the output by verification_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY verification_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "List stock_level, expires_at, manufacturer from products.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, expires_at, manufacturer FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get available, quantity, created_at, reconciliation_status by joining products with categories.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, expires_at, manufacturer, categories.created_at, categories.reconciliation_status FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.account_id;", "sql": null}, {"role": "user", "content": "Get the distribution of products across different categorie_id values.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(*) AS count FROM e-commerce.products GROUP BY categorie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reconciliation_status text NOT NULL,\n amount bigint,\n credit character varying(64) NOT NULL,\n payer_id varchar,\n verification_status char,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n quantity char,\n available varchar NOT NULL,\n stock_level char,\n manufacturer character varying(64),\n categorie_id text NOT NULL -- reference to categories.account_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(account_id)\n)", "conversations": [{"role": "user", "content": "List product_id, amount, verification_status from categories.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, amount, verification_status FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, amount, verification_status FROM e-commerce.categories WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, amount, verification_status FROM e-commerce.categories WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate sum of approval_status for each approval_status in payments.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(approval_status) AS sum_approval_status FROM finance.payments GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me expires_at, media_url, image_url for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, image_url FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, image_url FROM finance.loans WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, image_url FROM finance.loans WHERE media_url LIKE 'A%' ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve completed_at, quantity, fee for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, quantity, fee FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, quantity, fee FROM finance.payments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me min of account_id grouped by account_id for payments.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, MIN(account_id) AS min_account_id FROM finance.payments GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "List msrp, payment_id, media_url from loans.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, payment_id, media_url FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me payment_id, media_url, card_type, quantity from loans and their related payments.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, payment_id, media_url, payments.card_type, payments.quantity FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, payment_id, media_url, payments.card_type, payments.quantity FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.transaction_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the expires_at, payment_id, media_url of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, payment_id, media_url FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, payment_id, media_url FROM finance.loans WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, payment_id, media_url FROM finance.loans WHERE rating LIKE 'A%' ORDER BY media_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve payment_id, rating, expires_at for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, rating, expires_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve image_url, msrp, created_at, card_type showing the relationship between loans and payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, rating, expires_at, payments.created_at, payments.card_type FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, rating, expires_at, payments.created_at, payments.card_type FROM finance.loans JOIN finance.payments ON loans.payment_id = payments.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me customer_id, approval_status, account_id for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, account_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, account_id FROM finance.payments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different fee values.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM finance.payments GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n rating character varying(256),\n msrp character varying(256) NOT NULL,\n media_url character varying(128),\n image_url text NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at date,\n card_type text,\n quantity character varying(128),\n approval_status varchar,\n fee text,\n account_id character varying(256) NOT NULL -- identifier for account,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n due_date timestamp,\n reconciliation_status char,\n invoice_number char,\n user_id char NOT NULL -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n timezone text,\n salt text NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Get payment_id, media_url, rating from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, media_url, rating FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get all loans modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, media_url, rating FROM finance.loans WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group loans by payment_id and show the sum of msrp.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, SUM(msrp) AS sum_msrp FROM finance.loans GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by delivery_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY delivery_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, timezone, last_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, timezone, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by order_item_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, timezone, last_active FROM e-commerce.users ORDER BY order_item_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different joined_at values.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM e-commerce.users GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get completed_at, amount, payment_status from all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, amount, payment_status FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me payment_status, exchange_rate, order_item_id, status from order_items and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, amount, payment_status, users.order_item_id, users.status FROM e-commerce.order_items JOIN e-commerce.users ON order_items.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM e-commerce.order_items GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_active, timezone, website for every user.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, timezone, website FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get website, joined_at, amount, exchange_rate by joining users with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, timezone, website, order_items.amount, order_items.exchange_rate FROM e-commerce.users JOIN e-commerce.order_items ON users.order_item_id = order_items.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, timezone, website, order_items.amount, order_items.exchange_rate FROM e-commerce.users JOIN e-commerce.order_items ON users.order_item_id = order_items.transaction_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List last_active, website, joined_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, joined_at FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, joined_at FROM e-commerce.users ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, joined_at FROM e-commerce.users ORDER BY last_active DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me price, completed_at, amount for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT price, completed_at, amount FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT price, completed_at, amount FROM e-commerce.order_items WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group order_items by delivery_status and show the sum of payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, SUM(payment_status) AS sum_payment_status FROM e-commerce.order_items GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve price, amount, exchange_rate for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT price, amount, exchange_rate FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT price, amount, exchange_rate FROM e-commerce.order_items WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT price, amount, exchange_rate FROM e-commerce.order_items WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY exchange_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the amount, user_id, price of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT amount, user_id, price FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT amount, user_id, price FROM e-commerce.order_items ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Tally up order_items by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM e-commerce.order_items GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n website character varying(256),\n timezone varchar,\n status text,\n order_item_id integer NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n completed_at date,\n price decimal NOT NULL,\n delivery_status varchar,\n amount integer,\n payment_status varchar NOT NULL,\n exchange_rate text NOT NULL,\n user_id integer NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where price > 29.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE price > 29;", "sql": null}, {"role": "user", "content": "How many order_items are there per delivery_status?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM e-commerce.order_items GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the enrollment_id, last_active, address of each student?", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, last_active, address FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by enrollment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, last_active, address FROM education.students ORDER BY enrollment_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM education.students GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, created_at, last_active for all students.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, last_active FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, last_active FROM education.students ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "How many students are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.students GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days' ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with address in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY address DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Get address, customer_id, is_verified from all students.", "sql": null}, {"role": "assistant", "content": "SELECT address, customer_id, is_verified FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by is_verified ascending?", "sql": null}, {"role": "assistant", "content": "SELECT address, customer_id, is_verified FROM education.students ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.students GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Get last_active, status, created_at from all students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, status, created_at FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, status, created_at FROM education.students WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many students are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM education.students GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, customer_id, is_verified for every student.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, is_verified FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, is_verified FROM education.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, is_verified FROM education.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve status, last_active, address for every student.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, address FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, address FROM education.students ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Get sum of customer_id by last_active from students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, SUM(customer_id) AS sum_customer_id FROM education.students GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me is_verified, enrollment_id, created_at for all students.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, enrollment_id, created_at FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by is_verified descending?", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, enrollment_id, created_at FROM education.students ORDER BY is_verified DESC;", "sql": null}, {"role": "user", "content": "Sort the results by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, enrollment_id, created_at FROM education.students ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n is_verified bit,\n status character varying(256),\n address character varying(128),\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n updated_at timestamp without time zone,\n reconciliation_status char NOT NULL,\n customer_id text,\n amount integer NOT NULL,\n currency character varying(64),\n payee_id character varying(128) -- identifier for payee,\n reference_number character varying(256),\n exchange_rate character varying(256)\n)\n\nCREATE TABLE education.grades (\n account_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n verification_status character varying(64),\n user_id character varying(256) -- identifier for user,\n status char NOT NULL,\n balance bigint,\n customer_id character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get all students created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.clients;", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.clients ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "What is the max joined_at for each joined_at in clients?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(joined_at) AS max_joined_at FROM banking.clients GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Get reconciliation_status, reference_number, sale_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, reference_number, sale_id FROM banking.payments;", "sql": null}, {"role": "user", "content": "Show the results sorted by reference_number descending.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, reference_number, sale_id FROM banking.payments ORDER BY reference_number DESC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, reference_number, sale_id FROM banking.payments ORDER BY reference_number DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments WHERE payment_date BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments WHERE payment_date BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments;", "sql": null}, {"role": "user", "content": "Find payments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of payments in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM banking.payments GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "List approval_status, status, reconciliation_status from payments.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, reconciliation_status FROM banking.payments;", "sql": null}, {"role": "user", "content": "Can you order these by reconciliation_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, reconciliation_status FROM banking.payments ORDER BY reconciliation_status DESC;", "sql": null}, {"role": "user", "content": "Order the output by sale_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, reconciliation_status FROM banking.payments ORDER BY sale_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the email, is_verified, website of each client?", "sql": null}, {"role": "assistant", "content": "SELECT email, is_verified, website FROM banking.clients;", "sql": null}, {"role": "user", "content": "List clients with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT email, is_verified, website FROM banking.clients WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group clients by password_hash and show the count of email.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(email) AS count_email FROM banking.clients GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.clients;", "sql": null}, {"role": "user", "content": "List status, is_verified, sale_id, debit for each client along with their payment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.sale_id, payments.debit FROM banking.clients JOIN banking.payments ON clients.payment_id = payments.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.sale_id, payments.debit FROM banking.clients JOIN banking.payments ON clients.payment_id = payments.id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "List user_id, joined_at, updated_at from clients.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, joined_at, updated_at FROM banking.clients;", "sql": null}, {"role": "user", "content": "Get clients that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, joined_at, updated_at FROM banking.clients WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get average of user_id by status from clients.", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(user_id) AS average_user_id FROM banking.clients GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments;", "sql": null}, {"role": "user", "content": "Sort the results by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments ORDER BY payment_date DESC;", "sql": null}, {"role": "user", "content": "Calculate sum of reference_number for each sale_id in payments.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, SUM(reference_number) AS sum_reference_number FROM banking.payments GROUP BY sale_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_status character varying(256),\n fee text NOT NULL,\n payment_method character varying(64),\n exchange_rate character varying(256),\n approval_status character varying(128),\n amount decimal\n)\n\nCREATE TABLE banking.clients (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n joined_at date,\n email character varying(256),\n is_verified boolean NOT NULL,\n status character varying(64),\n website character varying(64) NOT NULL,\n password_hash character varying(128) NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE banking.payments (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n status char,\n reference_number text,\n reconciliation_status varchar NOT NULL,\n debit text,\n approval_status text,\n category text,\n sale_id text -- reference to sales.payment_id,\n FOREIGN KEY (sale_id) REFERENCES sales(payment_id)\n)", "conversations": [{"role": "user", "content": "Get reference_number, reconciliation_status, sale_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, reconciliation_status, sale_id FROM banking.payments;", "sql": null}, {"role": "user", "content": "What payment_date, debit, payment_status, exchange_rate do we have for payments and their associated sales?", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, reconciliation_status, sale_id, sales.payment_status, sales.exchange_rate FROM banking.payments JOIN banking.sales ON payments.sale_id = sales.payment_id;", "sql": null}, {"role": "user", "content": "How many payments are there per status?", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM banking.payments GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve phone, booking_id, created_at for every client.", "sql": null}, {"role": "assistant", "content": "SELECT phone, booking_id, created_at FROM retail.clients;", "sql": null}, {"role": "user", "content": "Get all clients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT phone, booking_id, created_at FROM retail.clients WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me max of employee_id grouped by created_at for clients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(employee_id) AS max_employee_id FROM retail.clients GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "List all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients;", "sql": null}, {"role": "user", "content": "Retrieve clients where employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE employee_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the age, country, joined_at of each client?", "sql": null}, {"role": "assistant", "content": "SELECT age, country, joined_at FROM retail.clients;", "sql": null}, {"role": "user", "content": "Get avatar, country, cancelled_at, status by joining clients with bookings.", "sql": null}, {"role": "assistant", "content": "SELECT age, country, joined_at, bookings.cancelled_at, bookings.status FROM retail.clients JOIN retail.bookings ON clients.booking_id = bookings.id;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT age, country, joined_at, bookings.cancelled_at, bookings.status FROM retail.clients JOIN retail.bookings ON clients.booking_id = bookings.id ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients;", "sql": null}, {"role": "user", "content": "Retrieve clients where avatar LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE avatar LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE avatar LIKE 'A%' ORDER BY employee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Get booking_id, employee_id, avatar from all clients.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, employee_id, avatar FROM retail.clients;", "sql": null}, {"role": "user", "content": "Show me age, country, status, delivery_status from clients and their related bookings.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, employee_id, avatar, bookings.status, bookings.delivery_status FROM retail.clients JOIN retail.bookings ON clients.booking_id = bookings.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by birth_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, employee_id, avatar, bookings.status, bookings.delivery_status FROM retail.clients JOIN retail.bookings ON clients.booking_id = bookings.id ORDER BY birth_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve avatar, birth_date, joined_at for every client.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, birth_date, joined_at FROM retail.clients;", "sql": null}, {"role": "user", "content": "Find clients where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, birth_date, joined_at FROM retail.clients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, birth_date, joined_at FROM retail.clients WHERE joined_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the employee_id, phone, age of each client?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, phone, age FROM retail.clients;", "sql": null}, {"role": "user", "content": "List clients that have booking_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, phone, age FROM retail.clients WHERE booking_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with country in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, phone, age FROM retail.clients WHERE booking_id LIKE 'A%' ORDER BY country DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients;", "sql": null}, {"role": "user", "content": "Show me clients with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with phone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE created_at > '2023-01-01' ORDER BY phone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients;", "sql": null}, {"role": "user", "content": "Retrieve clients where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.clients WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of clients in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM retail.clients GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.clients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n created_at timestamp without time zone,\n avatar text NOT NULL,\n phone character varying(64) NOT NULL,\n country char,\n age char,\n birth_date date,\n booking_id text -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.goods (\n product_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n price bigint,\n tax_rate text,\n rating text,\n stock_level text NOT NULL,\n title character varying(256)\n)\n\nCREATE TABLE retail.bookings (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at date,\n currency varchar,\n status char,\n delivery_status character varying(128),\n price decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the created_at, birth_date, employee_id of each client?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, birth_date, employee_id FROM retail.clients;", "sql": null}, {"role": "user", "content": "Find clients created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, birth_date, employee_id FROM retail.clients WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with avatar in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, birth_date, employee_id FROM retail.clients WHERE joined_at > '2023-12-01' ORDER BY avatar ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List edited_at, created_at, processed_at, category for each department along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.processed_at, grades.category FROM education.departments JOIN education.grades ON departments.grade_id = grades.account_id;", "sql": null}, {"role": "user", "content": "What is the count parent_id for each edited_at in departments?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(parent_id) AS count_parent_id FROM education.departments GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve rating, parent_id, grade_id for every department.", "sql": null}, {"role": "assistant", "content": "SELECT rating, parent_id, grade_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT rating, parent_id, grade_id FROM education.departments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT rating, parent_id, grade_id FROM education.departments WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Can you order these by amount descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY amount DESC;", "sql": null}, {"role": "user", "content": "What is the average category for each invoice_number in enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, AVERAGE(category) AS average_category FROM education.enrollments GROUP BY invoice_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "What are the processed_at, payer_id, amount of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payer_id, amount FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payer_id, amount FROM education.grades ORDER BY amount DESC;", "sql": null}, {"role": "user", "content": "Sort the results by payer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payer_id, amount FROM education.grades ORDER BY payer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different grade_id values.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.enrollments GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "List amount, updated_at, payer_id from grades.", "sql": null}, {"role": "assistant", "content": "SELECT amount, updated_at, payer_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT amount, updated_at, payer_id FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me count of updated_at grouped by processed_at for grades.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(updated_at) AS count_updated_at FROM education.grades GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE payment_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "What are the parent_id, created_at, rating of each department?", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, created_at, rating FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, created_at, rating FROM education.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by grade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, created_at, rating FROM education.departments WHERE created_at > '2023-01-01' ORDER BY grade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n rating text,\n parent_id varchar -- identifier for parent,\n views varchar,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n amount decimal NOT NULL,\n category text,\n payer_id character varying(64) -- identifier for payer,\n department_id text NOT NULL -- reference to departments.post_id,\n FOREIGN KEY (department_id) REFERENCES departments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n payment_date timestamp,\n reconciliation_status character varying(256),\n category character varying(256) NOT NULL,\n invoice_number character varying(128) NOT NULL,\n amount numeric(38,14),\n exchange_rate character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List grade_id, created_at, department_id, processed_at for each enrollment along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.department_id, grades.processed_at FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.account_id;", "sql": null}, {"role": "user", "content": "Calculate min of exchange_rate for each id in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(exchange_rate) AS min_exchange_rate FROM education.enrollments GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve email, password_hash, joined_at for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT email, password_hash, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT email, password_hash, joined_at FROM finance.customers WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different email values.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM finance.customers GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the email, account_status, joined_at of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT email, account_status, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT email, account_status, joined_at FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me sum of country grouped by country for customers.", "sql": null}, {"role": "assistant", "content": "SELECT country, SUM(country) AS sum_country FROM finance.customers GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List account_status, password_hash, email from customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, password_hash, email FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, password_hash, email FROM finance.customers ORDER BY account_status ASC;", "sql": null}, {"role": "user", "content": "Order the output by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, password_hash, email FROM finance.customers ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me created_at, subtotal, payment_status for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, subtotal, payment_status FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, subtotal, payment_status FROM finance.loans ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "How many loans are there per payment_status?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.loans GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List password_hash, joined_at, email from customers.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, joined_at, email FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, joined_at, email FROM finance.customers WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of joined_at grouped by password_hash for customers.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, MAX(joined_at) AS max_joined_at FROM finance.customers GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many loans are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.loans GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by password_hash ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-01-01' ORDER BY password_hash ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the email, password_hash, joined_at of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT email, password_hash, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT email, password_hash, joined_at FROM finance.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT email, password_hash, joined_at FROM finance.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n currency character varying(64),\n subtotal decimal,\n payment_status character varying(256),\n customer_id character varying(128) -- identifier for customer,\n status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n password_hash text,\n email character varying(128),\n country char,\n account_status character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me password_hash, email, account_status for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, email, account_status FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, email, account_status FROM finance.customers ORDER BY account_status DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, email, account_status FROM finance.customers ORDER BY account_status DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n account_status character varying(64),\n token char NOT NULL,\n is_active boolean,\n password_hash character varying(128) NOT NULL,\n phone character varying(64),\n last_name character varying(128),\n zip_code varchar NOT NULL,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n tax numeric,\n delivery_status character varying(64) NOT NULL,\n payment_method character varying(256),\n amount integer,\n product_id text,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n brand varchar,\n quantity character varying(64) NOT NULL,\n featured_rank character varying(256),\n views varchar,\n shippin_id integer NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of payment_method by order_item_id from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, SUM(payment_method) AS sum_payment_method FROM e-commerce.shipping GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n account_status character varying(64),\n token char NOT NULL,\n is_active boolean,\n password_hash character varying(128) NOT NULL,\n phone character varying(64),\n last_name character varying(128),\n zip_code varchar NOT NULL,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n tax numeric,\n delivery_status character varying(64) NOT NULL,\n payment_method character varying(256),\n amount integer,\n product_id text,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n brand varchar,\n quantity character varying(64) NOT NULL,\n featured_rank character varying(256),\n views varchar,\n shippin_id integer NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n account_status character varying(64),\n token char NOT NULL,\n is_active boolean,\n password_hash character varying(128) NOT NULL,\n phone character varying(64),\n last_name character varying(128),\n zip_code varchar NOT NULL,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n tax numeric,\n delivery_status character varying(64) NOT NULL,\n payment_method character varying(256),\n amount integer,\n product_id text,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n brand varchar,\n quantity character varying(64) NOT NULL,\n featured_rank character varying(256),\n views varchar,\n shippin_id integer NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of users in each is_active category.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(*) AS count FROM e-commerce.users GROUP BY is_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n account_status character varying(64),\n token char NOT NULL,\n is_active boolean,\n password_hash character varying(128) NOT NULL,\n phone character varying(64),\n last_name character varying(128),\n zip_code varchar NOT NULL,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n tax numeric,\n delivery_status character varying(64) NOT NULL,\n payment_method character varying(256),\n amount integer,\n product_id text,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n brand varchar,\n quantity character varying(64) NOT NULL,\n featured_rank character varying(256),\n views varchar,\n shippin_id integer NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group shipping by order_item_id and show the sum of tax.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, SUM(tax) AS sum_tax FROM e-commerce.shipping GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n account_status character varying(64),\n token char NOT NULL,\n is_active boolean,\n password_hash character varying(128) NOT NULL,\n phone character varying(64),\n last_name character varying(128),\n zip_code varchar NOT NULL,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n tax numeric,\n delivery_status character varying(64) NOT NULL,\n payment_method character varying(256),\n amount integer,\n product_id text,\n order_item_id text NOT NULL -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n brand varchar,\n quantity character varying(64) NOT NULL,\n featured_rank character varying(256),\n views varchar,\n shippin_id integer NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get users that match account_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE account_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group users by account_status and show the max of token.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, MAX(token) AS max_token FROM e-commerce.users GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "Show me last_active, person_id, username for all students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, person_id, username FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, person_id, username FROM education.students WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of students in each username category.", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(*) AS count FROM education.students GROUP BY username ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "What are the username, token, assignment_id of each student?", "sql": null}, {"role": "assistant", "content": "SELECT username, token, assignment_id FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT username, token, assignment_id FROM education.students WHERE last_active <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by first_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT username, token, assignment_id FROM education.students WHERE last_active <= CURRENT_DATE - INTERVAL '6 months' ORDER BY first_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get birth_date, country, joined_at, language by joining students with assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.joined_at, assignments.language FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Tally up students by username.", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(*) AS count FROM education.students GROUP BY username ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List timezone, person_id, joined_at, last_active for each student along with their assignment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.joined_at, assignments.last_active FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.joined_at, assignments.last_active FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get all students between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "Get username, assignment_id, first_name from all students.", "sql": null}, {"role": "assistant", "content": "SELECT username, assignment_id, first_name FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve username, timezone, language, joined_at showing the relationship between students and assignments.", "sql": null}, {"role": "assistant", "content": "SELECT username, assignment_id, first_name, assignments.language, assignments.joined_at FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT username, assignment_id, first_name, assignments.language, assignments.joined_at FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by first_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-12-01' ORDER BY first_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "What are the timezone, country, token of each student?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, country, token FROM education.students;", "sql": null}, {"role": "user", "content": "Get country, birth_date, joined_at, last_active by joining students with assignments.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, country, token, assignments.joined_at, assignments.last_active FROM education.students JOIN education.assignments ON students.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by birth_date.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM education.students GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "Get person_id, last_active, username from all students.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, last_active, username FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by birth_date descending?", "sql": null}, {"role": "assistant", "content": "SELECT person_id, last_active, username FROM education.students ORDER BY birth_date DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different country values.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM education.students GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n birth_date timestamp without time zone,\n country character varying(256),\n timezone character varying(128),\n token character varying(128),\n first_name char,\n username varchar NOT NULL,\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n username character varying(64),\n language character varying(256),\n zip_code character varying(128) NOT NULL,\n full_name text\n)", "conversations": [{"role": "user", "content": "What are the assignment_id, last_active, country of each student?", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, last_active, country FROM education.students;", "sql": null}, {"role": "user", "content": "Get all students created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, last_active, country FROM education.students WHERE birth_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by person_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, last_active, country FROM education.students WHERE birth_date > '2023-12-01' ORDER BY person_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "List category, post_id, image_url from groups.", "sql": null}, {"role": "assistant", "content": "SELECT category, post_id, image_url FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get groups that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT category, post_id, image_url FROM socialmedia.groups WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group groups by reserved and show the min of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, MIN(updated_at) AS min_updated_at FROM socialmedia.groups GROUP BY reserved;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by cost ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY cost ASC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY cost ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get groups that match reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of groups across different image_url values.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM socialmedia.groups GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Show me post_id, created_at, popularity_score for all followers.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, popularity_score FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me cost, created_at, likes, created_at from followers and their related posts.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, popularity_score, posts.likes, posts.created_at FROM socialmedia.followers JOIN socialmedia.posts ON followers.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Tally up followers by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM socialmedia.followers GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What featured_rank, category, subject, likes do we have for followers and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.subject, posts.likes FROM socialmedia.followers JOIN socialmedia.posts ON followers.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.subject, posts.likes FROM socialmedia.followers JOIN socialmedia.posts ON followers.post_id = posts.comment_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me expires_at, image_url, likes, subject from groups and their related posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.likes, posts.subject FROM socialmedia.groups JOIN socialmedia.posts ON groups.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Group groups by expires_at and show the average of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, AVERAGE(updated_at) AS average_updated_at FROM socialmedia.groups GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "List expires_at, views, updated_at from groups.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, updated_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve groups where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, updated_at FROM socialmedia.groups WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get max of category by category from groups.", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(category) AS max_category FROM socialmedia.groups GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me the count of followers grouped by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM socialmedia.followers GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up followers by post_id.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY post_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views varchar,\n category character varying(256),\n image_url character varying(64) NOT NULL,\n reserved char,\n post_id integer -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at date,\n category character varying(64),\n cost numeric,\n featured_rank character varying(64),\n popularity_score character varying(128) NOT NULL,\n thumbnail_url varchar,\n post_id integer NOT NULL -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n likes character varying(128),\n subject text\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, category, reserved for every group.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, category, reserved FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve post_id, expires_at, likes, created_at showing the relationship between groups and posts.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, category, reserved, posts.likes, posts.created_at FROM socialmedia.groups JOIN socialmedia.posts ON groups.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Group groups by updated_at and show the max of expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(expires_at) AS max_expires_at FROM socialmedia.groups GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List students that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where post_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE post_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group grades by updated_at and show the count of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(updated_at) AS count_updated_at FROM education.grades GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Get bio, avatar, last_active from all students.", "sql": null}, {"role": "assistant", "content": "SELECT bio, avatar, last_active FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by bio descending?", "sql": null}, {"role": "assistant", "content": "SELECT bio, avatar, last_active FROM education.students ORDER BY bio DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with avatar in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT bio, avatar, last_active FROM education.students ORDER BY avatar ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me token, id, bio for all students.", "sql": null}, {"role": "assistant", "content": "SELECT token, id, bio FROM education.students;", "sql": null}, {"role": "user", "content": "Arrange the results with api_key in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT token, id, bio FROM education.students ORDER BY api_key DESC;", "sql": null}, {"role": "user", "content": "Count the number of students in each api_key category.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM education.students GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me state, last_active, api_key for all students.", "sql": null}, {"role": "assistant", "content": "SELECT state, last_active, api_key FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT state, last_active, api_key FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT state, last_active, api_key FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me attachment_url, published_at, post_id for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, published_at, post_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, published_at, post_id FROM education.grades WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, published_at, post_id FROM education.grades WHERE updated_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Get published_at, updated_at, user_id from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, updated_at, user_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, updated_at, user_id FROM education.grades WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, updated_at, user_id FROM education.grades WHERE published_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the id, api_key, token of each student?", "sql": null}, {"role": "assistant", "content": "SELECT id, api_key, token FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, api_key, token FROM education.students WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get count of token by api_key from students.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(token) AS count_token FROM education.students GROUP BY api_key;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n published_at date,\n shares char NOT NULL,\n attachment_url character varying(128),\n user_id varchar\n)\n\nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n state character varying(256) NOT NULL,\n api_key character varying(256),\n token character varying(64) NOT NULL,\n avatar character varying(64) NOT NULL,\n bio character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Calculate count of bio for each last_active in students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(bio) AS count_bio FROM education.students GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List exchange_rate, currency, card_type, payment_method for each event along with their group information.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.card_type, groups.payment_method FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.order_id;", "sql": null}, {"role": "user", "content": "Count the number of events in each processed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM socialmedia.events GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get message_id, card_type, total, delivery_status by joining events with groups.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.total, groups.delivery_status FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.order_id;", "sql": null}, {"role": "user", "content": "Get count of group_id by group_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(group_id) AS count_group_id FROM socialmedia.events GROUP BY group_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY message_id ASC;", "sql": null}, {"role": "user", "content": "Tally up events by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.events GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me exchange_rate, user_id, payment_id for all events.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, user_id, payment_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What processed_at, group_id, payment_method, cancelled_at do we have for events and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, user_id, payment_id, groups.payment_method, groups.cancelled_at FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.order_id;", "sql": null}, {"role": "user", "content": "Calculate max of currency for each card_type in events.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MAX(currency) AS max_currency FROM socialmedia.events GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Retrieve card_type, exchange_rate, payment_id for every event.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, exchange_rate, payment_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me exchange_rate, user_id, quantity, cancelled_at from events and their related groups.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, exchange_rate, payment_id, groups.quantity, groups.cancelled_at FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.order_id;", "sql": null}, {"role": "user", "content": "Show me min of message_id grouped by user_id for events.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(message_id) AS min_message_id FROM socialmedia.events GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by group_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY group_id DESC;", "sql": null}, {"role": "user", "content": "What is the sum processed_at for each exchange_rate in events?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, SUM(processed_at) AS sum_processed_at FROM socialmedia.events GROUP BY exchange_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get currency, user_id, card_type from all events.", "sql": null}, {"role": "assistant", "content": "SELECT currency, user_id, card_type FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT currency, user_id, card_type FROM socialmedia.events WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up events by exchange_rate.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM socialmedia.events GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "List exchange_rate, card_type, currency from events.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, currency FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, currency FROM socialmedia.events WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by currency ascending?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, currency FROM socialmedia.events WHERE processed_at > '2023-12-01' ORDER BY currency ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n text varchar,\n views varchar NOT NULL,\n body character varying(256) NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.events (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n exchange_rate varchar,\n user_id char,\n card_type varchar NOT NULL,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.order_id,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (group_id) REFERENCES groups(order_id),\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at date,\n seller_id character varying(256) -- identifier for seller,\n quantity character varying(256),\n total smallint,\n user_id character varying(256) -- identifier for user,\n payment_method character varying(64),\n delivery_status varchar NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "List card_type, user_id, processed_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, user_id, processed_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, user_id, processed_at FROM socialmedia.events WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of events across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.events GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get grade_id, attachment_url, assignment_id, discount by joining assignments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.assignment_id, grades.discount FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.assignment_id, grades.discount FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "What are the quantity, completed_at, discount of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT quantity, completed_at, discount FROM education.grades;", "sql": null}, {"role": "user", "content": "Get assignment_id, quantity, views, likes by joining grades with assignments.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, completed_at, discount, assignments.views, assignments.likes FROM education.grades JOIN education.assignments ON grades.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "What is the count payment_status for each completed_at in grades?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(payment_status) AS count_payment_status FROM education.grades GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many assignments are there per user_id?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.assignments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve grade_id, created_at, likes for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, created_at, likes FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve likes, views, assignment_id, payment_status showing the relationship between assignments and grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, created_at, likes, grades.assignment_id, grades.payment_status FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, created_at, likes, grades.assignment_id, grades.payment_status FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me completed_at, payment_status, quantity for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, quantity FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, quantity FROM education.grades WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, quantity FROM education.grades WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get tags, grade_id, assignment_id, completed_at by joining assignments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.assignment_id, grades.completed_at FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Get average of created_at by likes from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT likes, AVERAGE(created_at) AS average_created_at FROM education.assignments GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with assignment_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY assignment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List attachment_url, tags, likes from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, tags, likes FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get grade_id, views, payment_status, completed_at by joining assignments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, tags, likes, grades.payment_status, grades.completed_at FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, tags, likes, grades.payment_status, grades.completed_at FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List grade_id, views, created_at from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, views, created_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, views, created_at FROM education.assignments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Order the output by grade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, views, created_at FROM education.assignments WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY grade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status char NOT NULL,\n discount numeric NOT NULL,\n quantity character varying(256) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.teachers (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n description text,\n state character varying(128),\n street character varying(256),\n country character varying(128) NOT NULL,\n location_lat varchar,\n operating_hours varchar\n)\n\nCREATE TABLE education.assignments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n attachment_url varchar NOT NULL,\n tags text,\n user_id character varying(128) -- identifier for user,\n likes text NOT NULL,\n views text,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me attachment_url, likes, grade_id for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, likes, grade_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, likes, grade_id FROM education.assignments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group assignments by created_at and show the average of grade_id.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, AVERAGE(grade_id) AS average_grade_id FROM education.assignments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me last_name, timezone, group_id for all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, timezone, group_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, timezone, group_id FROM socialmedia.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group users by status and show the min of joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT status, MIN(joined_at) AS min_joined_at FROM socialmedia.users GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Count the number of users in each last_name category.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, COUNT(*) AS count FROM socialmedia.users GROUP BY last_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users with status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE status LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me nationality, country, user_id for all groups.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, country, user_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by address descending.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, country, user_id FROM socialmedia.groups ORDER BY address DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, country, user_id FROM socialmedia.groups ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by group_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY group_id ASC;", "sql": null}, {"role": "user", "content": "How many users are there per group_id?", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(*) AS count FROM socialmedia.users GROUP BY group_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me user_id, address, joined_at, last_name from groups and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.joined_at, users.last_name FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.joined_at, users.last_name FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.customer_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get user_id, country, address from all groups.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, country, address FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get nationality, address, joined_at, last_name by joining groups with users.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, country, address, users.joined_at, users.last_name FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Show me the count of groups grouped by address.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM socialmedia.groups GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List nationality, timezone, last_active from groups.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, timezone, last_active FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "What timezone, address, joined_at, group_id do we have for groups and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT nationality, timezone, last_active, users.joined_at, users.group_id FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Show me max of last_active grouped by timezone for groups.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MAX(last_active) AS max_last_active FROM socialmedia.groups GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get status, group_id, timezone from all users.", "sql": null}, {"role": "assistant", "content": "SELECT status, group_id, timezone FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me group_id, joined_at, user_id, timezone from users and their related groups.", "sql": null}, {"role": "assistant", "content": "SELECT status, group_id, timezone, groups.user_id, groups.timezone FROM socialmedia.users JOIN socialmedia.groups ON users.group_id = groups.employee_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT status, group_id, timezone, groups.user_id, groups.timezone FROM socialmedia.users JOIN socialmedia.groups ON users.group_id = groups.employee_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_name char NOT NULL,\n status varchar,\n timezone varchar,\n group_id integer -- reference to groups.employee_id,\n FOREIGN KEY (group_id) REFERENCES groups(employee_id)\n)\n\nCREATE TABLE socialmedia.groups (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address character varying(64) NOT NULL,\n nationality character varying(128),\n timezone character varying(64),\n country character varying(128),\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the last_name, joined_at, group_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, joined_at, group_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, joined_at, group_id FROM socialmedia.users WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM socialmedia.users GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get all courses from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with capacity in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY capacity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "List type, capacity, attachment_url, created_at for each course along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.attachment_url, departments.created_at FROM education.courses JOIN education.departments ON courses.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Sort the results by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.attachment_url, departments.created_at FROM education.courses JOIN education.departments ON courses.department_id = departments.id ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me department_id, capacity, created_at, attachment_url from courses and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.created_at, departments.attachment_url FROM education.courses JOIN education.departments ON courses.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.created_at, departments.attachment_url FROM education.courses JOIN education.departments ON courses.department_id = departments.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, accessibility, geo_point from all courses.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, accessibility, geo_point FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, accessibility, geo_point FROM education.courses WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with capacity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, accessibility, geo_point FROM education.courses WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days' ORDER BY capacity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get all courses modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate sum of last_inspected for each accessibility in courses.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, SUM(last_inspected) AS sum_last_inspected FROM education.courses GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Can you order these by capacity descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY capacity DESC;", "sql": null}, {"role": "user", "content": "Sort the results by capacity descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY capacity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me geo_point, created_at, type for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, created_at, type FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses where type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, created_at, type FROM education.courses WHERE type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, created_at, type FROM education.courses WHERE type LIKE 'A%' ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Retrieve geo_point, last_inspected, keywords, attachment_url showing the relationship between courses and departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.keywords, departments.attachment_url FROM education.courses JOIN education.departments ON courses.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by type descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.keywords, departments.attachment_url FROM education.courses JOIN education.departments ON courses.department_id = departments.id ORDER BY type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n capacity varchar,\n geo_point text,\n type character varying(128),\n accessibility char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n keywords text NOT NULL,\n attachment_url character varying(64) NOT NULL,\n media_url character varying(64),\n visibility character varying(128)\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Arrange the results with capacity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY capacity DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by accessibility descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY accessibility DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations;", "sql": null}, {"role": "user", "content": "Show the results sorted by venue_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations ORDER BY venue_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of reservations in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM restaurant.reservations GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations;", "sql": null}, {"role": "user", "content": "Show me approval_status, quantity, updated_at, latitude from reservations and their related venues.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.updated_at, venues.latitude FROM restaurant.reservations JOIN restaurant.venues ON reservations.venue_id = venues.address_id;", "sql": null}, {"role": "user", "content": "Group reservations by updated_at and show the max of venue_id.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(venue_id) AS max_venue_id FROM restaurant.reservations GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations;", "sql": null}, {"role": "user", "content": "Order the output by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Tally up reservations by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM restaurant.reservations GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.venues;", "sql": null}, {"role": "user", "content": "What updated_at, customer_id, nationality, last_active do we have for venues and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.nationality, customers.last_active FROM restaurant.venues JOIN restaurant.customers ON venues.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.nationality, customers.last_active FROM restaurant.venues JOIN restaurant.customers ON venues.customer_id = customers.user_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.venues;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, updated_at, timezone, api_key showing the relationship between venues and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.timezone, customers.api_key FROM restaurant.venues JOIN restaurant.customers ON venues.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.timezone, customers.api_key FROM restaurant.venues JOIN restaurant.customers ON venues.customer_id = customers.user_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, updated_at, venue_id for every reservation.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, venue_id FROM restaurant.reservations;", "sql": null}, {"role": "user", "content": "Find reservations where quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, venue_id FROM restaurant.reservations WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many reservations are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM restaurant.reservations GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the customer_id, longitude, latitude of each venue?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, longitude, latitude FROM restaurant.venues;", "sql": null}, {"role": "user", "content": "Show the results sorted by latitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, longitude, latitude FROM restaurant.venues ORDER BY latitude ASC;", "sql": null}, {"role": "user", "content": "Tally up venues by latitude.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, COUNT(*) AS count FROM restaurant.venues GROUP BY latitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List location_lon, latitude, customer_id from venues.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, latitude, customer_id FROM restaurant.venues;", "sql": null}, {"role": "user", "content": "List venues with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, latitude, customer_id FROM restaurant.venues WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, latitude, customer_id FROM restaurant.venues WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List customer_id, latitude, location_lon from venues.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, latitude, location_lon FROM restaurant.venues;", "sql": null}, {"role": "user", "content": "Get venues that match longitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, latitude, location_lon FROM restaurant.venues WHERE longitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by latitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, latitude, location_lon FROM restaurant.venues WHERE longitude LIKE 'A%' ORDER BY latitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.venues (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n latitude character varying(64),\n longitude varchar,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE restaurant.reservations (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n approval_status character varying(64) NOT NULL,\n quantity character varying(64),\n venue_id integer -- reference to venues.address_id,\n FOREIGN KEY (venue_id) REFERENCES venues(address_id)\n)\n\nCREATE TABLE restaurant.customers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n nationality char NOT NULL,\n last_login date NOT NULL,\n api_key text,\n zip_code character varying(256) NOT NULL,\n timezone character varying(256) NOT NULL,\n username character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reservations;", "sql": null}, {"role": "user", "content": "List venue_id, created_at, longitude, updated_at for each reservation along with their venue information.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.longitude, venues.updated_at FROM restaurant.reservations JOIN restaurant.venues ON reservations.venue_id = venues.address_id;", "sql": null}, {"role": "user", "content": "Show me the count of reservations grouped by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM restaurant.reservations GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the postal_code, purchase_id, zip_code of each addresse?", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, purchase_id, zip_code FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show the results sorted by accessibility descending.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, purchase_id, zip_code FROM realestate.addresses ORDER BY accessibility DESC;", "sql": null}, {"role": "user", "content": "Order the output by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, purchase_id, zip_code FROM realestate.addresses ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up addresses by country.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM realestate.addresses GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE created_at > '2023-12-01' ORDER BY accessibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Get addresses that match accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of postal_code grouped by category for addresses.", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(postal_code) AS max_postal_code FROM realestate.addresses GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Get purchase_id, postal_code, status, payment_status by joining addresses with purchases.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.status, purchases.payment_status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.status, purchases.payment_status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the accessibility, purchase_id, postal_code of each addresse?", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, purchase_id, postal_code FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Sort the results by zip_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, purchase_id, postal_code FROM realestate.addresses ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Order the output by venue_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, purchase_id, postal_code FROM realestate.addresses ORDER BY venue_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "What zip_code, venue_id, payment_status, status do we have for addresses and their associated purchases?", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.payment_status, purchases.status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id;", "sql": null}, {"role": "user", "content": "Sort the results by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.payment_status, purchases.status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of venue_id by created_at from addresses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(venue_id) AS max_venue_id FROM realestate.addresses GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with venue_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE venue_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group addresses by zip_code and show the min of zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, MIN(zip_code) AS min_zip_code FROM realestate.addresses GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n birth_date timestamp NOT NULL,\n membership_level varchar,\n zip_code character varying(256),\n last_login timestamp without time zone NOT NULL\n)\n\nCREATE TABLE realestate.purchases (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n discount bigint NOT NULL,\n payment_status varchar,\n status character varying(256) NOT NULL\n)\n\nCREATE TABLE realestate.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n postal_code character varying(256),\n accessibility character varying(256) NOT NULL,\n country varchar,\n category char NOT NULL,\n zip_code varchar NOT NULL,\n purchase_id integer -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "List purchase_id, postal_code, updated_at, payment_status for each addresse along with their purchase information.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.updated_at, purchases.payment_status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.updated_at, purchases.payment_status FROM realestate.addresses JOIN realestate.purchases ON addresses.purchase_id = purchases.payment_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get published_at, title, shares from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, title, shares FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by format descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, title, shares FROM healthcare.departments ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Order the output by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, title, shares FROM healthcare.departments ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where patient_id > 17.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE patient_id > 17;", "sql": null}, {"role": "user", "content": "Show me max of shares grouped by subject for departments.", "sql": null}, {"role": "assistant", "content": "SELECT subject, MAX(shares) AS max_shares FROM healthcare.departments GROUP BY subject;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, address, last_active of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address, last_active FROM healthcare.patients WHERE last_active <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by api_key.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM healthcare.patients GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments with shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE shares LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with format in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Show me average of title grouped by shares for departments.", "sql": null}, {"role": "assistant", "content": "SELECT shares, AVERAGE(title) AS average_title FROM healthcare.departments GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by appointment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active = CURRENT_DATE - INTERVAL '1 day' ORDER BY appointment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, last_active, api_key for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_active, api_key FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_active, api_key FROM healthcare.patients WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by address descending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_active, api_key FROM healthcare.patients WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY address DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the api_key, updated_at, last_active of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, updated_at, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get all patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, updated_at, last_active FROM healthcare.patients WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the max updated_at for each api_key in patients?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, MAX(updated_at) AS max_updated_at FROM healthcare.patients GROUP BY api_key;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the sum api_key for each api_key in patients?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, SUM(api_key) AS sum_api_key FROM healthcare.patients GROUP BY api_key;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n address text,\n api_key character varying(128),\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n shares text,\n format char,\n title character varying(256),\n subject char,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp without time zone,\n user_id varchar,\n customer_id char,\n reconciliation_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me subject, shares, title for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT subject, shares, title FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve format, shares, api_key, last_active showing the relationship between departments and patients.", "sql": null}, {"role": "assistant", "content": "SELECT subject, shares, title, patients.api_key, patients.last_active FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.person_id;", "sql": null}, {"role": "user", "content": "Calculate average of published_at for each subject in departments.", "sql": null}, {"role": "assistant", "content": "SELECT subject, AVERAGE(published_at) AS average_published_at FROM healthcare.departments GROUP BY subject;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "What loan_id, updated_at, discount, exchange_rate do we have for audits and their associated loans?", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.discount, loans.exchange_rate FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.invoice_id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.discount, loans.exchange_rate FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.invoice_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List loan_id, updated_at, name from audits.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, updated_at, name FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me name, transaction_id, traded_at, status from audits and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, updated_at, name, loans.traded_at, loans.status FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.invoice_id;", "sql": null}, {"role": "user", "content": "Tally up audits by transaction_id.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM finance.audits GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at > '2023-01-01' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "How many audits are there per longitude?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(*) AS count FROM finance.audits GROUP BY longitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve loan_id, transaction_id, seller_id, exchange_rate showing the relationship between audits and loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.seller_id, loans.exchange_rate FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.invoice_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.seller_id, loans.exchange_rate FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.invoice_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the name, loan_id, transaction_id of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT name, loan_id, transaction_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits that have longitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, loan_id, transaction_id FROM finance.audits WHERE longitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min description for each name in audits?", "sql": null}, {"role": "assistant", "content": "SELECT name, MIN(description) AS min_description FROM finance.audits GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY transaction_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up audits by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.audits GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the transaction_id, description, updated_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, description, updated_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by loan_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, description, updated_at FROM finance.audits ORDER BY loan_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, description, updated_at FROM finance.audits ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude text,\n name character varying(64),\n description varchar,\n loan_id text NOT NULL -- reference to loans.invoice_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n delivery_status text,\n exchange_rate varchar NOT NULL,\n customer_id varchar -- identifier for customer,\n product_id text -- identifier for product,\n discount smallint\n)\n\nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n state character varying(256),\n last_login date,\n avatar text\n)\n\nCREATE TABLE finance.loans (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n traded_at timestamp,\n status varchar,\n account_id char NOT NULL -- identifier for account,\n exchange_rate text,\n card_type character varying(128) NOT NULL,\n discount numeric(38,14),\n seller_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Sort the results by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Show me sum of description grouped by loan_id for audits.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, SUM(description) AS sum_description FROM finance.audits GROUP BY loan_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the review_id, seller_id, subtotal of each order?", "sql": null}, {"role": "assistant", "content": "SELECT review_id, seller_id, subtotal FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, seller_id, subtotal FROM e-commerce.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Sort the results by review_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, seller_id, subtotal FROM e-commerce.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY review_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What account_id, seller_id, shares, updated_at do we have for orders and their associated reviews?", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.shares, reviews.updated_at FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.shares, reviews.updated_at FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve seller_id, review_id, account_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, review_id, account_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Order the output by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, review_id, account_id FROM e-commerce.orders ORDER BY account_id ASC;", "sql": null}, {"role": "user", "content": "Group orders by subtotal and show the min of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, MIN(created_at) AS min_created_at FROM e-commerce.orders GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the created_at, subtotal, approval_status of each order?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, subtotal, approval_status FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve review_id, seller_id, parent_id, shares showing the relationship between orders and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, subtotal, approval_status, reviews.parent_id, reviews.shares FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Can you order these by subtotal ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, subtotal, approval_status, reviews.parent_id, reviews.shares FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id ORDER BY subtotal ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve review_id, subtotal, seller_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, subtotal, seller_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, subtotal, seller_id FROM e-commerce.orders WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, subtotal, seller_id FROM e-commerce.orders WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the subtotal, seller_id, review_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, seller_id, review_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List orders with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, seller_id, review_id FROM e-commerce.orders WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of orders in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM e-commerce.orders GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get subtotal, seller_id, account_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, seller_id, account_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Order the output by seller_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, seller_id, account_id FROM e-commerce.orders ORDER BY seller_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, seller_id, account_id FROM e-commerce.orders ORDER BY seller_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM e-commerce.orders GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get account_id, created_at, approval_status from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, created_at, approval_status FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders with account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, created_at, approval_status FROM e-commerce.orders WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n subtotal integer,\n account_id varchar -- identifier for account,\n seller_id character varying(64) NOT NULL,\n approval_status text,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at date,\n popularity_score character varying(64),\n available character varying(128) NOT NULL,\n subcategory character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parent_id char -- identifier for parent,\n user_id character varying(128) NOT NULL,\n shares character varying(128) NOT NULL,\n format char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get approval_status, subtotal, shares, format by joining orders with reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.shares, reviews.format FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.shares, reviews.format FROM e-commerce.orders JOIN e-commerce.reviews ON orders.review_id = reviews.message_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_number, credit, status for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, credit, status FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, credit, status FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, credit, status FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "List views, featured_rank, title from events.", "sql": null}, {"role": "assistant", "content": "SELECT views, featured_rank, title FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT views, featured_rank, title FROM socialmedia.events WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of events in each expires_at category.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM socialmedia.events GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY payment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by tax_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY tax_rate ASC;", "sql": null}, {"role": "user", "content": "Show me the count of events grouped by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM socialmedia.events GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "List credit, exchange_rate, status from followers.", "sql": null}, {"role": "assistant", "content": "SELECT credit, exchange_rate, status FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get all followers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT credit, exchange_rate, status FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT credit, exchange_rate, status FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Retrieve available, tax_rate, featured_rank for every event.", "sql": null}, {"role": "assistant", "content": "SELECT available, tax_rate, featured_rank FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT available, tax_rate, featured_rank FROM socialmedia.events WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT available, tax_rate, featured_rank FROM socialmedia.events WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "List rating, views, featured_rank from events.", "sql": null}, {"role": "assistant", "content": "SELECT rating, views, featured_rank FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get all events older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT rating, views, featured_rank FROM socialmedia.events WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, views, featured_rank FROM socialmedia.events WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Retrieve balance, created_at, credit for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT balance, created_at, credit FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT balance, created_at, credit FROM socialmedia.followers ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "What is the max exchange_rate for each credit in followers?", "sql": null}, {"role": "assistant", "content": "SELECT credit, MAX(exchange_rate) AS max_exchange_rate FROM socialmedia.followers GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get count of title by tax_rate from events.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, COUNT(title) AS count_title FROM socialmedia.events GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate char,\n invoice_number char NOT NULL,\n balance decimal,\n status character varying(64),\n category character varying(128) NOT NULL,\n credit character varying(256)\n)\n\nCREATE TABLE socialmedia.events (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n rating character varying(64),\n title char,\n featured_rank char,\n available character varying(64),\n views text,\n tax_rate text,\n quantity text\n)", "conversations": [{"role": "user", "content": "Show me tax_rate, quantity, views for all events.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, quantity, views FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, quantity, views FROM socialmedia.events WHERE item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, quantity, views FROM socialmedia.events WHERE item_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n views character varying(64),\n parent_id character varying(128),\n visibility varchar NOT NULL,\n user_id integer -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n score text,\n user_id character varying(64),\n thumbnail varchar,\n format text,\n author_id character varying(128) -- identifier for author\n)\n\nCREATE TABLE socialmedia.events (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp without time zone,\n email character varying(64) NOT NULL,\n country text,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n salt character varying(64) NOT NULL,\n last_name character varying(128),\n full_name varchar,\n event_id text NOT NULL -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.followers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n gender varchar NOT NULL,\n website char,\n api_key character varying(128) NOT NULL,\n token character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by country descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reference_number, updated_at, account_id for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, updated_at, account_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records that have patient_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, updated_at, account_id FROM healthcare.medical_records WHERE patient_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, updated_at, account_id FROM healthcare.medical_records WHERE patient_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get all patients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by first_name.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM healthcare.patients GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by due_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY due_date DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY due_date DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve account_id, doctor_id, reference_number for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, doctor_id, reference_number FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records from last week.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, doctor_id, reference_number FROM healthcare.medical_records WHERE due_date >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, doctor_id, reference_number FROM healthcare.medical_records WHERE due_date >= CURRENT_DATE - INTERVAL '7 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List zip_code, updated_at, last_inspected, location_lon for each patient along with their doctor information.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.last_inspected, doctors.location_lon FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.location_id;", "sql": null}, {"role": "user", "content": "Calculate sum of email for each first_name in patients.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, SUM(email) AS sum_email FROM healthcare.patients GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Sort the results by token descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY token DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY token DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get doctor_id, patient_id, vendor_id from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, patient_id, vendor_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Order the output by vendor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, patient_id, vendor_id FROM healthcare.medical_records ORDER BY vendor_id DESC;", "sql": null}, {"role": "user", "content": "Group medical_records by vendor_id and show the average of doctor_id.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, AVERAGE(doctor_id) AS average_doctor_id FROM healthcare.medical_records GROUP BY vendor_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, email, password_hash from patients.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, email, password_hash FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by password_hash ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, email, password_hash FROM healthcare.patients ORDER BY password_hash ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, email, password_hash FROM healthcare.patients ORDER BY password_hash ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List due_date, reference_number, updated_at from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, updated_at FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by doctor_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, updated_at FROM healthcare.medical_records ORDER BY doctor_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by verification_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, updated_at FROM healthcare.medical_records ORDER BY verification_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp,\n description character varying(128),\n street character varying(256),\n location_lon character varying(64),\n capacity char,\n longitude text NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n first_name varchar,\n token character varying(128),\n email character varying(64),\n zip_code varchar,\n doctor_id text -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp without time zone,\n vendor_id character varying(256) -- identifier for vendor,\n verification_status char NOT NULL,\n reference_number varchar,\n doctor_id text NOT NULL -- reference to doctors.location_id,\n patient_id text -- reference to patients.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve doctor_id, password_hash, street, updated_at showing the relationship between patients and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.street, doctors.updated_at FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.location_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.street, doctors.updated_at FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.location_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY username ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with department_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY department_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "List username, is_active, first_name from students.", "sql": null}, {"role": "assistant", "content": "SELECT username, is_active, first_name FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT username, is_active, first_name FROM education.students WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group students by username and show the average of nationality.", "sql": null}, {"role": "assistant", "content": "SELECT username, AVERAGE(nationality) AS average_nationality FROM education.students GROUP BY username;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, is_active, joined_at for every student.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, joined_at FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by nationality ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, joined_at FROM education.students ORDER BY nationality ASC;", "sql": null}, {"role": "user", "content": "Sort the results by department_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, joined_at FROM education.students ORDER BY department_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Sort the results by backorder ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Group departments by tax_rate and show the average of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, AVERAGE(published_at) AS average_published_at FROM education.departments GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "Show me is_active, updated_at, phone for all students.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, updated_at, phone FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, updated_at, phone FROM education.students WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of username for each updated_at in students.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(username) AS max_username FROM education.students GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "List tax_rate, available, quantity from departments.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, available, quantity FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, available, quantity FROM education.departments ORDER BY quantity DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, available, quantity FROM education.departments ORDER BY quantity DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "List is_active, joined_at, username from students.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, joined_at, username FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with department_id > 100.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, joined_at, username FROM education.students WHERE department_id > 100;", "sql": null}, {"role": "user", "content": "Can you order these by first_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, joined_at, username FROM education.students WHERE department_id > 100 ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n capacity text,\n location_lon character varying(128),\n address_line1 varchar,\n student_id text NOT NULL -- reference to students.employee_id,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id),\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n is_active bit,\n phone character varying(128),\n nationality text NOT NULL,\n username character varying(64),\n first_name character varying(64) NOT NULL,\n department_id integer NOT NULL -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)\n\nCREATE TABLE education.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n quantity character varying(64),\n backorder character varying(128) NOT NULL,\n available varchar NOT NULL,\n tax_rate character varying(128),\n assignment_id integer -- reference to assignments.address_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me max of address_line1 grouped by created_at for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(address_line1) AS max_address_line1 FROM education.assignments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the country, username, salt of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT country, username, salt FROM banking.customers;", "sql": null}, {"role": "user", "content": "Can you order these by gender ascending?", "sql": null}, {"role": "assistant", "content": "SELECT country, username, salt FROM banking.customers ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Tally up customers by birth_date.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM banking.customers GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Show me sales with delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE delivery_status LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Retrieve total, discount, gender, updated_at showing the relationship between sales and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.gender, customers.updated_at FROM banking.sales JOIN banking.customers ON sales.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "What is the count buyer_id for each discount in sales?", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(buyer_id) AS count_buyer_id FROM banking.sales GROUP BY discount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Show me sales with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with total in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE created_at > '2023-01-01' ORDER BY total ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get account_status, updated_at, salt from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, updated_at, salt FROM banking.customers;", "sql": null}, {"role": "user", "content": "Get all customers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, updated_at, salt FROM banking.customers WHERE birth_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by sale_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT account_status, updated_at, salt FROM banking.customers WHERE birth_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY sale_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, delivery_status, discount for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, delivery_status, discount FROM banking.sales;", "sql": null}, {"role": "user", "content": "Get all sales created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, delivery_status, discount FROM banking.sales WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, delivery_status, discount FROM banking.sales WHERE created_at > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List delivery_status, amount, customer_id from sales.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, amount, customer_id FROM banking.sales;", "sql": null}, {"role": "user", "content": "Get all sales from last week.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, amount, customer_id FROM banking.sales WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of sales grouped by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM banking.sales GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List sale_id, gender, birth_date from customers.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, gender, birth_date FROM banking.customers;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, gender, birth_date FROM banking.customers ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by country descending?", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, gender, birth_date FROM banking.customers ORDER BY country DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.customers;", "sql": null}, {"role": "user", "content": "Retrieve created_at, username, total, delivery_status showing the relationship between customers and sales.", "sql": null}, {"role": "assistant", "content": "SELECT *, sales.total, sales.delivery_status FROM banking.customers JOIN banking.sales ON customers.sale_id = sales.order_id;", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by account_status.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(*) AS count FROM banking.customers GROUP BY account_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n traded_at timestamp,\n total numeric,\n payment_status varchar,\n delivery_status varchar NOT NULL,\n discount numeric(38,14),\n buyer_id character varying(256),\n amount decimal,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE banking.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n birth_date timestamp NOT NULL,\n username character varying(128) NOT NULL,\n account_status varchar,\n gender character varying(64),\n salt character varying(256),\n country text NOT NULL,\n sale_id text -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE banking.invoices (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n approval_status character varying(256),\n credit character varying(64) NOT NULL,\n reconciliation_status varchar,\n notes varchar NOT NULL,\n status varchar,\n description character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "List sales with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me average of amount grouped by delivery_status for sales.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, AVERAGE(amount) AS average_amount FROM banking.sales GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get all metadata older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get average of category by location_lon from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, AVERAGE(category) AS average_category FROM tradingplatform.metadata GROUP BY location_lon;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, location_lon, category for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, category FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Arrange the results with name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, category FROM tradingplatform.metadata ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "What is the max name for each type in metadata?", "sql": null}, {"role": "assistant", "content": "SELECT type, MAX(name) AS max_name FROM tradingplatform.metadata GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, user_id, metadat_id for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, user_id, metadat_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, user_id, metadat_id FROM tradingplatform.wallets WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, user_id, metadat_id FROM tradingplatform.wallets WHERE user_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve reference_number, metadat_id, wallet_id, location_lon showing the relationship between wallets and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.wallet_id, metadata.location_lon FROM tradingplatform.wallets JOIN tradingplatform.metadata ON wallets.metadat_id = metadata.venue_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.wallet_id, metadata.location_lon FROM tradingplatform.wallets JOIN tradingplatform.metadata ON wallets.metadat_id = metadata.venue_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "List location_lon, category, name from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, name FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, name FROM tradingplatform.metadata WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, name FROM tradingplatform.metadata WHERE last_inspected > '2023-01-01' ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Can you order these by wallet_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY wallet_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY wallet_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by wallet_id.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY wallet_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Order the output by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with last_inspected in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n location_lon character varying(64) NOT NULL,\n type character varying(256),\n category varchar,\n name text NOT NULL,\n parking_available varchar,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n debit text NOT NULL,\n reconciliation_status character varying(128),\n reference_number varchar,\n user_id char -- identifier for user,\n exchange_rate character varying(64),\n metadat_id text -- reference to metadata.venue_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List category, location_lon, reference_number, exchange_rate for each metadata along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.reference_number, wallets.exchange_rate FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Arrange the results with location_lon in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.reference_number, wallets.exchange_rate FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.payment_id ORDER BY location_lon DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Show me id, updated_at, delivery_status for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT id, updated_at, delivery_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT id, updated_at, delivery_status FROM finance.payments WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT id, updated_at, delivery_status FROM finance.payments WHERE processed_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Get delivery_status, tax, processed_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, tax, processed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, tax, processed_at FROM finance.payments WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the min delivery_status for each currency in payments?", "sql": null}, {"role": "assistant", "content": "SELECT currency, MIN(delivery_status) AS min_delivery_status FROM finance.payments GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List currency, tax, operating_hours, zip_code for each payment along with their loan information.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.operating_hours, loans.zip_code FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id;", "sql": null}, {"role": "user", "content": "What is the min tax for each tax in payments?", "sql": null}, {"role": "assistant", "content": "SELECT tax, MIN(tax) AS min_tax FROM finance.payments GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me loan_id, tax, address_line1, location_lat from payments and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.address_line1, loans.location_lat FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by id.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM finance.payments GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Get currency, id, loan_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT currency, id, loan_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT currency, id, loan_id FROM finance.payments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT currency, id, loan_id FROM finance.payments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me currency, updated_at, location_lat, created_at from payments and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.location_lat, loans.created_at FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id;", "sql": null}, {"role": "user", "content": "How many payments are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.payments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me tax, currency, created_at, location_lat from payments and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.created_at, loans.location_lat FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id;", "sql": null}, {"role": "user", "content": "Can you order these by tax ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.created_at, loans.location_lat FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id ORDER BY tax ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me id, tax, location_lat, created_at from payments and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.location_lat, loans.created_at FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.location_lat, loans.created_at FROM finance.payments JOIN finance.loans ON payments.loan_id = loans.address_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n address_line1 character varying(256),\n address_line2 varchar,\n operating_hours char,\n city char,\n location_lat character varying(64),\n zip_code varchar\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n delivery_status text NOT NULL,\n tax numeric(38,14) NOT NULL,\n currency character varying(128),\n loan_id text NOT NULL -- reference to loans.address_id,\n FOREIGN KEY (loan_id) REFERENCES loans(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where loan_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE loan_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by tax ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE loan_id LIKE 'A%' ORDER BY tax ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List product_id, investment_id, nationality, website for each loan along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.nationality, investments.website FROM finance.loans JOIN finance.investments ON loans.investment_id = investments.employee_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by price ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.nationality, investments.website FROM finance.loans JOIN finance.investments ON loans.investment_id = investments.employee_id ORDER BY price ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans that have invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE invoice_id LIKE 'A%' ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY status ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, investment_id, product_id for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT status, investment_id, product_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Sort the results by product_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, investment_id, product_id FROM finance.loans ORDER BY product_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of loans in each processed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.loans GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "List processed_at, subtotal, approval_status from loans.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, subtotal, approval_status FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by price descending?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, subtotal, approval_status FROM finance.loans ORDER BY price DESC;", "sql": null}, {"role": "user", "content": "Show me the count of loans grouped by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.loans GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where subtotal > 46.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE subtotal > 46;", "sql": null}, {"role": "user", "content": "Calculate min of subtotal for each invoice_id in loans.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, MIN(subtotal) AS min_subtotal FROM finance.loans GROUP BY invoice_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of loans in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM finance.loans GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get loans that match invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by investment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE invoice_id LIKE 'A%' ORDER BY investment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me approval_status, invoice_id, investment_id for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, invoice_id, investment_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve investment_id, product_id, email, website showing the relationship between loans and investments.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, invoice_id, investment_id, investments.email, investments.website FROM finance.loans JOIN finance.investments ON loans.investment_id = investments.employee_id;", "sql": null}, {"role": "user", "content": "Show me max of processed_at grouped by product_id for loans.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, MAX(processed_at) AS max_processed_at FROM finance.loans GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n buyer_id char,\n customer_id varchar,\n exchange_rate text NOT NULL,\n payment_method char,\n fee character varying(128),\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.investments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n website text,\n nationality character varying(256),\n birth_date timestamp,\n email character varying(128),\n salt text\n)\n\nCREATE TABLE finance.loans (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_status character varying(256),\n product_id character varying(256) NOT NULL,\n price smallint,\n subtotal decimal,\n status character varying(128) NOT NULL,\n approval_status text,\n investment_id text NOT NULL -- reference to investments.employee_id,\n FOREIGN KEY (investment_id) REFERENCES investments(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me approval_status, price, processed_at for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, price, processed_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me status, invoice_id, email, nationality from loans and their related investments.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, price, processed_at, investments.email, investments.nationality FROM finance.loans JOIN finance.investments ON loans.investment_id = investments.employee_id;", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different investment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, COUNT(*) AS count FROM finance.loans GROUP BY investment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders with payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE payment_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Sort the results by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY user_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Get customer_id, payment_id, created_at from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, created_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders where categorie_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, created_at FROM e-commerce.orders WHERE categorie_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, created_at FROM e-commerce.orders WHERE categorie_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get all orders modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, categorie_id, customer_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, categorie_id, customer_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, categorie_id, customer_id FROM e-commerce.orders WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the api_key, is_active, last_active of each user?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, is_active, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Sort the results by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, is_active, last_active FROM e-commerce.users ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, is_active, last_active FROM e-commerce.users ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "Get currency, created_at, customer_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, customer_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, customer_id FROM e-commerce.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, customer_id FROM e-commerce.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n attachment_url character varying(256),\n format character varying(256),\n tags text\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp,\n language text,\n is_active boolean -- indicates if active is true,\n city character varying(256),\n api_key character varying(128),\n categorie_id text -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n approval_status varchar,\n customer_id character varying(256),\n currency character varying(64),\n price decimal,\n categorie_id text NOT NULL -- reference to categories.address_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(address_id)\n)\n\nCREATE TABLE e-commerce.categories (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n postal_code text NOT NULL,\n street character varying(128),\n name varchar,\n location_lon character varying(128) NOT NULL,\n address_line1 character varying(256) NOT NULL,\n city character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the categorie_id, price, payment_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, price, payment_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, price, payment_id FROM e-commerce.orders ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, price, payment_id FROM e-commerce.orders ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Get currency, billin_id, amount from all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, billin_id, amount FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by billin_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT currency, billin_id, amount FROM healthcare.prescriptions ORDER BY billin_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, billin_id, amount FROM healthcare.prescriptions ORDER BY payment_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me updated_at, views, billin_id, notes from billing and their related prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.billin_id, prescriptions.notes FROM healthcare.billing JOIN healthcare.prescriptions ON billing.prescription_id = prescriptions.payment_id;", "sql": null}, {"role": "user", "content": "Arrange the results with discount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.billin_id, prescriptions.notes FROM healthcare.billing JOIN healthcare.prescriptions ON billing.prescription_id = prescriptions.payment_id ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE thumbnail_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, reference_number, thumbnail_url, updated_at showing the relationship between prescriptions and billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.thumbnail_url, billing.updated_at FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.item_id;", "sql": null}, {"role": "user", "content": "Show me max of payment_date grouped by approval_status for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MAX(payment_date) AS max_payment_date FROM healthcare.prescriptions GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "List amount, vendor_id, notes from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT amount, vendor_id, notes FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me payment_date, billin_id, updated_at, thumbnail_url from prescriptions and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT amount, vendor_id, notes, billing.updated_at, billing.thumbnail_url FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.item_id;", "sql": null}, {"role": "user", "content": "Arrange the results with billin_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT amount, vendor_id, notes, billing.updated_at, billing.thumbnail_url FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.item_id ORDER BY billin_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY discount ASC;", "sql": null}, {"role": "user", "content": "What is the count updated_at for each thumbnail_url in billing?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(updated_at) AS count_updated_at FROM healthcare.billing GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "What are the approval_status, payment_date, vendor_id of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_date, vendor_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by amount ascending?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_date, vendor_id FROM healthcare.prescriptions ORDER BY amount ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_date, vendor_id FROM healthcare.prescriptions ORDER BY amount ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve vendor_id, approval_status, payment_date for every prescription.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, approval_status, payment_date FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Order the output by billin_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, approval_status, payment_date FROM healthcare.prescriptions ORDER BY billin_id ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, approval_status, payment_date FROM healthcare.prescriptions ORDER BY billin_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Show me billin_id, amount, payment_date for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, amount, payment_date FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, amount, payment_date FROM healthcare.prescriptions WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of amount for each approval_status in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, AVERAGE(amount) AS average_amount FROM healthcare.prescriptions GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(128) NOT NULL,\n name char,\n views varchar,\n discount integer,\n prescription_id text -- reference to prescriptions.payment_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount numeric,\n reference_number character varying(128),\n currency character varying(64),\n approval_status character varying(128),\n notes varchar,\n vendor_id character varying(64),\n billin_id text -- reference to billing.item_id,\n FOREIGN KEY (billin_id) REFERENCES billing(item_id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY updated_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me assignment_id, updated_at, amount for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, updated_at, amount FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, updated_at, amount FROM education.enrollments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by verification_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, updated_at, amount FROM education.enrollments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY verification_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve credit, exchange_rate, verification_status for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT credit, exchange_rate, verification_status FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT credit, exchange_rate, verification_status FROM education.grades WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group grades by credit and show the average of payment_date.", "sql": null}, {"role": "assistant", "content": "SELECT credit, AVERAGE(payment_date) AS average_payment_date FROM education.grades GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me amount, balance, verification_status for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT amount, balance, verification_status FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments where debit LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT amount, balance, verification_status FROM education.enrollments WHERE debit LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different debit values.", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM education.enrollments GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by debit.", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM education.enrollments GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE due_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE due_date = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve payer_id, exchange_rate, payment_date for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, exchange_rate, payment_date FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve verification_status, payment_date, assignment_id, debit showing the relationship between grades and enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, exchange_rate, payment_date, enrollments.assignment_id, enrollments.debit FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.invoice_id;", "sql": null}, {"role": "user", "content": "How many grades are there per verification_status?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM education.grades GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "List amount, balance, updated_at from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT amount, balance, updated_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me verification_status, debit, brand, manufacturer from enrollments and their related assignments.", "sql": null}, {"role": "assistant", "content": "SELECT amount, balance, updated_at, assignments.brand, assignments.manufacturer FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.sku;", "sql": null}, {"role": "user", "content": "Order the output by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT amount, balance, updated_at, assignments.brand, assignments.manufacturer FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.sku ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get debit, assignment_id, balance from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT debit, assignment_id, balance FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me updated_at, amount, subcategory, thumbnail_url from enrollments and their related assignments.", "sql": null}, {"role": "assistant", "content": "SELECT debit, assignment_id, balance, assignments.subcategory, assignments.thumbnail_url FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.sku;", "sql": null}, {"role": "user", "content": "Get count of assignment_id by balance from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT balance, COUNT(assignment_id) AS count_assignment_id FROM education.enrollments GROUP BY balance;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by verification_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY verification_status DESC;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit character varying(64),\n amount smallint NOT NULL,\n balance smallint NOT NULL,\n verification_status character varying(64) NOT NULL,\n assignment_id integer NOT NULL -- reference to assignments.sku,\n FOREIGN KEY (assignment_id) REFERENCES assignments(sku)\n)\n\nCREATE TABLE education.assignments (\n sku integer PRIMARY KEY -- unique identifier,\n created_at date,\n subcategory varchar,\n brand character varying(256),\n manufacturer character varying(128),\n media_url character varying(128),\n thumbnail_url character varying(64) NOT NULL\n)\n\nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n due_date timestamp without time zone,\n approval_status character varying(256) NOT NULL,\n payer_id character varying(128),\n category varchar NOT NULL,\n exchange_rate character varying(64),\n verification_status text,\n user_id text,\n credit varchar,\n enrollment_id text NOT NULL -- reference to enrollments.invoice_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, due_date, assignment_id, verification_status showing the relationship between grades and enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT *, enrollments.assignment_id, enrollments.verification_status FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.invoice_id;", "sql": null}, {"role": "user", "content": "Tally up grades by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.grades GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Display all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.branches;", "sql": null}, {"role": "user", "content": "Order the output by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.branches ORDER BY address_line2 ASC;", "sql": null}, {"role": "user", "content": "Order the output by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.branches ORDER BY comment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "What are the address_line2, zip_code, updated_at of each branche?", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, zip_code, updated_at FROM insurance.branches;", "sql": null}, {"role": "user", "content": "List category, updated_at, subject, published_at for each branche along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, zip_code, updated_at, comments.subject, comments.published_at FROM insurance.branches JOIN insurance.comments ON branches.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of branches across different parking_available values.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM insurance.branches GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.branches;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, coordinates, published_at, subject showing the relationship between branches and comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.published_at, comments.subject FROM insurance.branches JOIN insurance.comments ON branches.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.published_at, comments.subject FROM insurance.branches JOIN insurance.comments ON branches.comment_id = comments.message_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "What are the category, type, parking_available of each branche?", "sql": null}, {"role": "assistant", "content": "SELECT category, type, parking_available FROM insurance.branches;", "sql": null}, {"role": "user", "content": "Find branches where parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, type, parking_available FROM insurance.branches WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of branches grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM insurance.branches GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments;", "sql": null}, {"role": "user", "content": "Get all comments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Group comments by views and show the max of media_url.", "sql": null}, {"role": "assistant", "content": "SELECT views, MAX(media_url) AS max_media_url FROM insurance.comments GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve categories, rating, user_id for every comment.", "sql": null}, {"role": "assistant", "content": "SELECT categories, rating, user_id FROM insurance.comments;", "sql": null}, {"role": "user", "content": "List comments that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT categories, rating, user_id FROM insurance.comments WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many comments are there per user_id?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM insurance.comments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by categories ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments ORDER BY categories ASC;", "sql": null}, {"role": "user", "content": "Sort the results by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments ORDER BY media_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.branches;", "sql": null}, {"role": "user", "content": "List comment_id, parking_available, published_at, media_url for each branche along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.published_at, comments.media_url FROM insurance.branches JOIN insurance.comments ON branches.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Group branches by zip_code and show the max of address_line2.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, MAX(address_line2) AS max_address_line2 FROM insurance.branches GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n coordinates text,\n category character varying(128),\n zip_code character varying(64),\n address_line2 char,\n parking_available char,\n type character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE insurance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n currency character varying(64) NOT NULL,\n payment_status character varying(64) NOT NULL,\n amount numeric(38,14),\n payment_method character varying(256),\n approval_status text NOT NULL,\n subtotal numeric NOT NULL\n)\n\nCREATE TABLE insurance.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n categories character varying(64),\n views text NOT NULL,\n subject char,\n media_url varchar NOT NULL,\n user_id text,\n rating character varying(256) NOT NULL,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.comments;", "sql": null}, {"role": "user", "content": "Retrieve subject, published_at, payment_status, approval_status showing the relationship between comments and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.payment_status, transactions.approval_status FROM insurance.comments JOIN insurance.transactions ON comments.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Show me sum of subject grouped by rating for comments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, SUM(subject) AS sum_subject FROM insurance.comments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve timezone, addresse_id, salt for every student.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, addresse_id, salt FROM insurance.students;", "sql": null}, {"role": "user", "content": "Show me created_at, salt, city, state from students and their related addresses.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, addresse_id, salt, addresses.city, addresses.state FROM insurance.students JOIN insurance.addresses ON students.addresse_id = addresses.location_id;", "sql": null}, {"role": "user", "content": "Get max of addresse_id by salt from students.", "sql": null}, {"role": "assistant", "content": "SELECT salt, MAX(addresse_id) AS max_addresse_id FROM insurance.students GROUP BY salt;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve capacity, state, city for every addresse.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, state, city FROM insurance.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with capacity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, state, city FROM insurance.addresses WHERE capacity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, state, city FROM insurance.addresses WHERE capacity LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve timezone, created_at, addresse_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, created_at, addresse_id FROM insurance.students;", "sql": null}, {"role": "user", "content": "Sort the results by timezone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, created_at, addresse_id FROM insurance.students ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, created_at, addresse_id FROM insurance.students ORDER BY timezone ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.students;", "sql": null}, {"role": "user", "content": "Show me students with city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.students WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with addresse_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.students WHERE city LIKE 'A%' ORDER BY addresse_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, city, addresse_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, city, addresse_id FROM insurance.students;", "sql": null}, {"role": "user", "content": "List students with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, city, addresse_id FROM insurance.students WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, city, addresse_id FROM insurance.students WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, city, capacity from all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, city, capacity FROM insurance.addresses;", "sql": null}, {"role": "user", "content": "Show me state, description, content, edited_at from addresses and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, city, capacity, reviews.content, reviews.edited_at FROM insurance.addresses JOIN insurance.reviews ON addresses.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "Can you order these by longitude ascending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, city, capacity, reviews.content, reviews.edited_at FROM insurance.addresses JOIN insurance.reviews ON addresses.review_id = reviews.post_id ORDER BY longitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Get created_at, review_id, state from all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, review_id, state FROM insurance.addresses;", "sql": null}, {"role": "user", "content": "Get addresses that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, review_id, state FROM insurance.addresses WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by state ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, review_id, state FROM insurance.addresses WHERE created_at > '2023-01-01' ORDER BY state ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Get review_id, capacity, postal_code from all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, capacity, postal_code FROM insurance.addresses;", "sql": null}, {"role": "user", "content": "Show me last_inspected, capacity, user_id, content from addresses and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, capacity, postal_code, reviews.user_id, reviews.content FROM insurance.addresses JOIN insurance.reviews ON addresses.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "What is the max description for each created_at in addresses?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(description) AS max_description FROM insurance.addresses GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Show me capacity, city, postal_code for all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, city, postal_code FROM insurance.addresses;", "sql": null}, {"role": "user", "content": "Arrange the results with review_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, city, postal_code FROM insurance.addresses ORDER BY review_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by last_inspected descending?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, city, postal_code FROM insurance.addresses ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n city character varying(64),\n capacity varchar,\n description character varying(256),\n longitude character varying(64) NOT NULL,\n state character varying(128),\n postal_code character varying(64),\n review_id text NOT NULL -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE insurance.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n content text,\n shares character varying(64),\n rating char,\n visibility character varying(128) NOT NULL,\n user_id character varying(64) NOT NULL -- identifier for user\n)\n\nCREATE TABLE insurance.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt text,\n city character varying(64),\n timezone character varying(128) NOT NULL,\n addresse_id text -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, timezone, addresse_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, timezone, addresse_id FROM insurance.students;", "sql": null}, {"role": "user", "content": "Sort the results by timezone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, timezone, addresse_id FROM insurance.students ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, timezone, addresse_id FROM insurance.students ORDER BY timezone ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve display_name, age, api_key for every user.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, age, api_key FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, age, api_key FROM tradingplatform.users WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get count of employee_id by phone from users.", "sql": null}, {"role": "assistant", "content": "SELECT phone, COUNT(employee_id) AS count_employee_id FROM tradingplatform.users GROUP BY phone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve display_name, api_key, last_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, api_key, last_active FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, api_key, last_active FROM tradingplatform.users ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show me max of api_key grouped by employee_id for users.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, MAX(api_key) AS max_api_key FROM tradingplatform.users GROUP BY employee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "What are the joined_at, display_name, employee_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, display_name, employee_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get phone, employee_id, full_name, last_active by joining users with logs.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, display_name, employee_id, logs.full_name, logs.last_active FROM tradingplatform.users JOIN tradingplatform.logs ON users.log_id = logs.employee_id;", "sql": null}, {"role": "user", "content": "Group users by joined_at and show the max of log_id.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(log_id) AS max_log_id FROM tradingplatform.users GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "List last_active, joined_at, display_name from users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, display_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, display_name FROM tradingplatform.users ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Count the number of users in each display_name category.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me joined_at, age, log_id for all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, age, log_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get phone, age, last_active, full_name by joining users with logs.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, age, log_id, logs.last_active, logs.full_name FROM tradingplatform.users JOIN tradingplatform.logs ON users.log_id = logs.employee_id;", "sql": null}, {"role": "user", "content": "Sort the results by log_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, age, log_id, logs.last_active, logs.full_name FROM tradingplatform.users JOIN tradingplatform.logs ON users.log_id = logs.employee_id ORDER BY log_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users with employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE employee_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "List log_id, last_active, joined_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, last_active, joined_at FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List last_active, phone, api_key, full_name for each user along with their log information.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, last_active, joined_at, logs.api_key, logs.full_name FROM tradingplatform.users JOIN tradingplatform.logs ON users.log_id = logs.employee_id;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different api_key values.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM tradingplatform.users GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with api_key in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE last_active > '2023-01-01' ORDER BY api_key DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Order the output by age descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY age DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n account_status character varying(256),\n api_key character varying(256) NOT NULL,\n age character varying(128) NOT NULL,\n full_name character varying(256)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n payment_date timestamp,\n status character varying(128),\n reference_number text,\n debit char,\n notes character varying(256) NOT NULL,\n reconciliation_status text\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n last_active date,\n api_key varchar,\n phone text,\n display_name varchar,\n age char,\n log_id text NOT NULL -- reference to logs.employee_id,\n FOREIGN KEY (log_id) REFERENCES logs(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Order the output by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp without time zone,\n account_id char -- identifier for account,\n fee character varying(128),\n currency character varying(128),\n subtotal bigint,\n appointment_id text NOT NULL -- reference to appointments.sku,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.appointments (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n popularity_score char,\n backorder character varying(64) NOT NULL,\n views varchar NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n salt character varying(64),\n status text,\n last_login date\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n salt text,\n is_verified boolean NOT NULL,\n website character varying(64) NOT NULL,\n language varchar,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Order the output by language ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY language ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY language ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp without time zone,\n account_id char -- identifier for account,\n fee character varying(128),\n currency character varying(128),\n subtotal bigint,\n appointment_id text NOT NULL -- reference to appointments.sku,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.appointments (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n popularity_score char,\n backorder character varying(64) NOT NULL,\n views varchar NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n salt character varying(64),\n status text,\n last_login date\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n salt text,\n is_verified boolean NOT NULL,\n website character varying(64) NOT NULL,\n language varchar,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp without time zone,\n account_id char -- identifier for account,\n fee character varying(128),\n currency character varying(128),\n subtotal bigint,\n appointment_id text NOT NULL -- reference to appointments.sku,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.appointments (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n popularity_score char,\n backorder character varying(64) NOT NULL,\n views varchar NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n salt character varying(64),\n status text,\n last_login date\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n salt text,\n is_verified boolean NOT NULL,\n website character varying(64) NOT NULL,\n language varchar,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Can you order these by subtotal descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY subtotal DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY subtotal DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp without time zone,\n account_id char -- identifier for account,\n fee character varying(128),\n currency character varying(128),\n subtotal bigint,\n appointment_id text NOT NULL -- reference to appointments.sku,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.appointments (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n popularity_score char,\n backorder character varying(64) NOT NULL,\n views varchar NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n salt character varying(64),\n status text,\n last_login date\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n salt text,\n is_verified boolean NOT NULL,\n website character varying(64) NOT NULL,\n language varchar,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Sort the results by appointment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY appointment_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by appointment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY appointment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp without time zone,\n account_id char -- identifier for account,\n fee character varying(128),\n currency character varying(128),\n subtotal bigint,\n appointment_id text NOT NULL -- reference to appointments.sku,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.appointments (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n popularity_score char,\n backorder character varying(64) NOT NULL,\n views varchar NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n salt character varying(64),\n status text,\n last_login date\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n salt text,\n is_verified boolean NOT NULL,\n website character varying(64) NOT NULL,\n language varchar,\n appointment_id text NOT NULL -- reference to appointments.sku,\n FOREIGN KEY (appointment_id) REFERENCES appointments(sku)\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many prescriptions are there per salt?", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Show me description, audit_id, customer_id for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT description, audit_id, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me audit_id, reconciliation_status, traded_at, card_type from accounts and their related audits.", "sql": null}, {"role": "assistant", "content": "SELECT description, audit_id, customer_id, audits.traded_at, audits.card_type FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, audit_id, customer_id, audits.traded_at, audits.card_type FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Show me due_date, audit_id, description for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, audit_id, description FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, description, account_id, card_type showing the relationship between accounts and audits.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, audit_id, description, audits.account_id, audits.card_type FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Show me average of status grouped by reconciliation_status for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, AVERAGE(status) AS average_status FROM finance.accounts GROUP BY reconciliation_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List due_date, description, account_id, traded_at for each account along with their audit information.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.account_id, audits.traded_at FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Get sum of audit_id by audit_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, SUM(audit_id) AS sum_audit_id FROM finance.accounts GROUP BY audit_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM finance.accounts GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match due_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM finance.accounts GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Sort the results by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payment_date DESC;", "sql": null}, {"role": "user", "content": "Sort the results by reconciliation_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY reconciliation_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What notes, exchange_rate, subtotal, account_id do we have for accounts and their associated audits?", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.subtotal, audits.account_id FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.subtotal, audits.account_id FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.invoice_id ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY exchange_rate DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "List audit_id, description, reconciliation_status from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, reconciliation_status FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, description, reconciliation_status FROM finance.accounts WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each customer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.accounts GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n reconciliation_status character varying(256),\n customer_id text,\n description text NOT NULL,\n notes character varying(64),\n exchange_rate character varying(256),\n status character varying(128),\n audit_id text -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n card_type character varying(64) NOT NULL,\n subtotal smallint,\n account_id char\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each notes category.", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM finance.accounts GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List longitude, created_at, created_at, postal_code for each enrollment along with their course information.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.created_at, courses.postal_code FROM education.enrollments JOIN education.courses ON enrollments.course_id = courses.location_id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.created_at, courses.postal_code FROM education.enrollments JOIN education.courses ON enrollments.course_id = courses.location_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the course_id, operating_hours, updated_at of each enrollment?", "sql": null}, {"role": "assistant", "content": "SELECT course_id, operating_hours, updated_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, operating_hours, updated_at FROM education.enrollments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM education.enrollments GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve course_id, longitude, operating_hours for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, longitude, operating_hours FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, longitude, operating_hours FROM education.enrollments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each course_id category.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, COUNT(*) AS count FROM education.enrollments GROUP BY course_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me edited_at, attachment_url, published_at for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, attachment_url, published_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve views, enrollment_id, created_at, longitude showing the relationship between grades and enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, attachment_url, published_at, enrollments.created_at, enrollments.longitude FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.venue_id;", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different published_at values.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM education.grades GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, updated_at, description of each enrollment?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, description FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, description FROM education.enrollments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by course_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, description FROM education.enrollments WHERE created_at > '2023-01-01' ORDER BY course_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different description values.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM education.enrollments GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with views in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY views DESC;", "sql": null}, {"role": "user", "content": "Order the output by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM education.enrollments GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n description character varying(128),\n operating_hours character varying(128) NOT NULL,\n longitude character varying(128) NOT NULL,\n course_id integer NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)\n\nCREATE TABLE education.courses (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n longitude text,\n geo_point character varying(256),\n description character varying(128) NOT NULL,\n postal_code char\n)\n\nCREATE TABLE education.grades (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n user_id text,\n attachment_url character varying(64),\n views character varying(128),\n enrollment_id text -- reference to enrollments.venue_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(venue_id)\n)", "conversations": [{"role": "user", "content": "List user_id, edited_at, published_at from grades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, edited_at, published_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, edited_at, published_at FROM education.grades WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by enrollment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, edited_at, published_at FROM education.grades WHERE edited_at > '2023-01-01' ORDER BY enrollment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me capacity, created_at, country for all locations.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, created_at, country FROM media.locations;", "sql": null}, {"role": "user", "content": "Can you order these by reservation_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, created_at, country FROM media.locations ORDER BY reservation_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, created_at, country FROM media.locations ORDER BY reservation_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.locations;", "sql": null}, {"role": "user", "content": "What country, created_at, approval_status, buyer_id do we have for locations and their associated reservations?", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.approval_status, reservations.buyer_id FROM media.locations JOIN media.reservations ON locations.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different capacity values.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM media.locations GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "List capacity, reservation_id, created_at from locations.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, reservation_id, created_at FROM media.locations;", "sql": null}, {"role": "user", "content": "Sort the results by capacity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, reservation_id, created_at FROM media.locations ORDER BY capacity ASC;", "sql": null}, {"role": "user", "content": "Group locations by capacity and show the average of reservation_id.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, AVERAGE(reservation_id) AS average_reservation_id FROM media.locations GROUP BY capacity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get capacity, country, created_at from all locations.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, country, created_at FROM media.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, country, created_at FROM media.locations WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of locations in each capacity category.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM media.locations GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me reservation_id, capacity, country for all locations.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, capacity, country FROM media.locations;", "sql": null}, {"role": "user", "content": "List locations that have country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, capacity, country FROM media.locations WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of reservation_id for each created_at in locations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(reservation_id) AS sum_reservation_id FROM media.locations GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve country, capacity, reservation_id for every location.", "sql": null}, {"role": "assistant", "content": "SELECT country, capacity, reservation_id FROM media.locations;", "sql": null}, {"role": "user", "content": "Show me reservation_id, created_at, approval_status, buyer_id from locations and their related reservations.", "sql": null}, {"role": "assistant", "content": "SELECT country, capacity, reservation_id, reservations.approval_status, reservations.buyer_id FROM media.locations JOIN media.reservations ON locations.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT country, capacity, reservation_id, reservations.approval_status, reservations.buyer_id FROM media.locations JOIN media.reservations ON locations.reservation_id = reservations.order_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.locations;", "sql": null}, {"role": "user", "content": "List capacity, reservation_id, price, total for each location along with their reservation information.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.price, reservations.total FROM media.locations JOIN media.reservations ON locations.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Group locations by country and show the average of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT country, AVERAGE(created_at) AS average_created_at FROM media.locations GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the country, created_at, reservation_id of each location?", "sql": null}, {"role": "assistant", "content": "SELECT country, created_at, reservation_id FROM media.locations;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT country, created_at, reservation_id FROM media.locations ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT country, created_at, reservation_id FROM media.locations ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.locations;", "sql": null}, {"role": "user", "content": "Retrieve country, capacity, approval_status, total showing the relationship between locations and reservations.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.approval_status, reservations.total FROM media.locations JOIN media.reservations ON locations.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "How many locations are there per capacity?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM media.locations GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.locations (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n country character varying(128) NOT NULL,\n capacity character varying(64),\n reservation_id text -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)\n\nCREATE TABLE media.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n price numeric(38,14) NOT NULL,\n currency character varying(256) NOT NULL,\n buyer_id varchar NOT NULL -- identifier for buyer,\n approval_status char NOT NULL,\n total smallint NOT NULL,\n card_type varchar\n)\n\nCREATE TABLE media.billing (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n credit character varying(64),\n category character varying(128),\n vendor_id char NOT NULL -- identifier for vendor,\n notes character varying(128),\n status varchar NOT NULL,\n user_id character varying(256) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.locations;", "sql": null}, {"role": "user", "content": "Get all locations between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.locations WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group locations by country and show the sum of country.", "sql": null}, {"role": "assistant", "content": "SELECT country, SUM(country) AS sum_country FROM media.locations GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "What format, attachment_url, parking_available, last_inspected do we have for posts and their associated facilities?", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.parking_available, facilities.last_inspected FROM insurance.posts JOIN insurance.facilities ON posts.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "What is the max message_id for each message_id in posts?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, MAX(message_id) AS max_message_id FROM insurance.posts GROUP BY message_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve facilitie_id, attachment_url, reply_to_id for every post.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, attachment_url, reply_to_id FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Retrieve message_id, tags, last_inspected, city showing the relationship between posts and facilities.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, attachment_url, reply_to_id, facilities.last_inspected, facilities.city FROM insurance.posts JOIN insurance.facilities ON posts.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, attachment_url, reply_to_id, facilities.last_inspected, facilities.city FROM insurance.posts JOIN insurance.facilities ON posts.facilitie_id = facilities.address_id ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Show me posts with attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of attachment_url for each tags in posts.", "sql": null}, {"role": "assistant", "content": "SELECT tags, COUNT(attachment_url) AS count_attachment_url FROM insurance.posts GROUP BY tags;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Can you order these by reply_to_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY reply_to_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with facilitie_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY facilitie_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Sort the results by attachment_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY attachment_url ASC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY attachment_url ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Show me format, published_at, last_inspected, city from posts and their related facilities.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.last_inspected, facilities.city FROM insurance.posts JOIN insurance.facilities ON posts.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "How many posts are there per message_id?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM insurance.posts GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Find posts older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List facilitie_id, published_at, tags from posts.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, published_at, tags FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Show me posts that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, published_at, tags FROM insurance.posts WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by reply_to_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, published_at, tags FROM insurance.posts WHERE published_at > '2023-12-01' ORDER BY reply_to_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Retrieve format, message_id, timezone, city showing the relationship between posts and facilities.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.timezone, facilities.city FROM insurance.posts JOIN insurance.facilities ON posts.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "Tally up posts by attachment_url.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, COUNT(*) AS count FROM insurance.posts GROUP BY attachment_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n format character varying(128),\n attachment_url character varying(64) NOT NULL,\n reply_to_id text,\n views character varying(256),\n tags character varying(256) NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE insurance.facilities (\n address_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n operating_hours text,\n parking_available character varying(128) NOT NULL,\n timezone character varying(256),\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.posts ORDER BY published_at DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Get membership_level, updated_at, display_name from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, updated_at, display_name FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me membership_level, display_name, media_url, text from shipping and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, updated_at, display_name, reviews.media_url, reviews.text FROM e-commerce.shipping JOIN e-commerce.reviews ON shipping.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of shipping across different display_name values.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM e-commerce.shipping GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE last_login >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE last_login >= CURRENT_DATE - INTERVAL '30 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "List all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me display_name, membership_level, created_at, keywords from shipping and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.created_at, reviews.keywords FROM e-commerce.shipping JOIN e-commerce.reviews ON shipping.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.created_at, reviews.keywords FROM e-commerce.shipping JOIN e-commerce.reviews ON shipping.review_id = reviews.message_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Sort the results by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY joined_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by bio ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY bio ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, display_name, membership_level for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, display_name, membership_level FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get last_login, nationality, keywords, media_url by joining shipping with reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, display_name, membership_level, reviews.keywords, reviews.media_url FROM e-commerce.shipping JOIN e-commerce.reviews ON shipping.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Sort the results by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, display_name, membership_level, reviews.keywords, reviews.media_url FROM e-commerce.shipping JOIN e-commerce.reviews ON shipping.review_id = reviews.message_id ORDER BY display_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Show me joined_at, review_id, updated_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, review_id, updated_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, review_id, updated_at FROM e-commerce.shipping WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of membership_level grouped by last_login for shipping.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, AVERAGE(membership_level) AS average_membership_level FROM e-commerce.shipping GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE email LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match review_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE review_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE review_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "What are the last_login, email, display_name of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, email, display_name FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, email, display_name FROM e-commerce.shipping WHERE last_login = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of shipping across different membership_level values.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, COUNT(*) AS count FROM e-commerce.shipping GROUP BY membership_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at timestamp,\n email character varying(256),\n display_name character varying(256),\n nationality character varying(128) NOT NULL,\n membership_level varchar NOT NULL,\n last_login timestamp without time zone,\n bio character varying(128) NOT NULL,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url varchar NOT NULL,\n keywords char,\n text varchar\n)\n\nCREATE TABLE e-commerce.categories (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(64),\n display_name character varying(256),\n state character varying(128),\n membership_level char\n)", "conversations": [{"role": "user", "content": "What are the membership_level, bio, review_id of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, bio, review_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Can you order these by review_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, bio, review_id FROM e-commerce.shipping ORDER BY review_id ASC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, bio, review_id FROM e-commerce.shipping ORDER BY review_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Show me country, first_name, api_key for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, api_key FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, api_key FROM education.departments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by api_key descending.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, api_key FROM education.departments WHERE updated_at > '2023-01-01' ORDER BY api_key DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "What are the content_id, tags, edited_at of each enrollment?", "sql": null}, {"role": "assistant", "content": "SELECT content_id, tags, edited_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Sort the results by edited_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, tags, edited_at FROM education.enrollments ORDER BY edited_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by tags descending.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, tags, edited_at FROM education.enrollments ORDER BY tags DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with age in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY age DESC;", "sql": null}, {"role": "user", "content": "Group departments by age and show the average of teacher_id.", "sql": null}, {"role": "assistant", "content": "SELECT age, AVERAGE(teacher_id) AS average_teacher_id FROM education.departments GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of departments in each joined_at category.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM education.departments GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match teacher_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE teacher_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many enrollments are there per keywords?", "sql": null}, {"role": "assistant", "content": "SELECT keywords, COUNT(*) AS count FROM education.enrollments GROUP BY keywords ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Get tags, edited_at, content_id from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT tags, edited_at, content_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT tags, edited_at, content_id FROM education.enrollments WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT tags, edited_at, content_id FROM education.enrollments WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Order the output by is_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY is_active DESC;", "sql": null}, {"role": "user", "content": "Get sum of is_active by first_name from departments.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, SUM(is_active) AS sum_is_active FROM education.departments GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve api_key, age, zip_code for every department.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, zip_code FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, zip_code FROM education.departments WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, zip_code FROM education.departments WHERE last_login > '2023-01-01' ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Show me is_active, age, country for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, age, country FROM education.departments;", "sql": null}, {"role": "user", "content": "Get all departments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, age, country FROM education.departments WHERE last_login <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group departments by teacher_id and show the max of country.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, MAX(country) AS max_country FROM education.departments GROUP BY teacher_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n updated_at date,\n views character varying(64),\n keywords varchar,\n tags text NOT NULL,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n department_id integer -- reference to departments.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id),\n FOREIGN KEY (department_id) REFERENCES departments(employee_id)\n)\n\nCREATE TABLE education.teachers (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n delivery_status char,\n exchange_rate char,\n payment_method character varying(256) NOT NULL\n)\n\nCREATE TABLE education.departments (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n country text,\n zip_code character varying(128),\n first_name text,\n age char,\n api_key char NOT NULL,\n last_login timestamp,\n is_active boolean -- indicates if active is true,\n teacher_id text NOT NULL -- reference to teachers.order_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "What teacher_id, last_login, exchange_rate, updated_at do we have for departments and their associated teachers?", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.exchange_rate, teachers.updated_at FROM education.departments JOIN education.teachers ON departments.teacher_id = teachers.order_id;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.exchange_rate, teachers.updated_at FROM education.departments JOIN education.teachers ON departments.teacher_id = teachers.order_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by location_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at > '2023-12-01' ORDER BY location_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Show me message_id, state, postal_code for all groups.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, state, postal_code FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get operating_hours, state, edited_at, updated_at by joining groups with messages.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, state, postal_code, messages.edited_at, messages.updated_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, state, postal_code, messages.edited_at, messages.updated_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get location_id, postal_code, updated_at from all groups.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, postal_code, updated_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by location_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, postal_code, updated_at FROM socialmedia.groups ORDER BY location_id DESC;", "sql": null}, {"role": "user", "content": "How many groups are there per state?", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM socialmedia.groups GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve operating_hours, country, edited_at, updated_at showing the relationship between groups and messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.edited_at, messages.updated_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Count the number of groups in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM socialmedia.groups GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "List country, location_id, operating_hours from groups.", "sql": null}, {"role": "assistant", "content": "SELECT country, location_id, operating_hours FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me location_id, updated_at, rating, updated_at from groups and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT country, location_id, operating_hours, messages.rating, messages.updated_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Show me average of updated_at grouped by state for groups.", "sql": null}, {"role": "assistant", "content": "SELECT state, AVERAGE(updated_at) AS average_updated_at FROM socialmedia.groups GROUP BY state;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of groups grouped by operating_hours.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM socialmedia.groups GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "What are the operating_hours, country, message_id of each group?", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, country, message_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Arrange the results with message_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, country, message_id FROM socialmedia.groups ORDER BY message_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, country, message_id FROM socialmedia.groups ORDER BY message_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE country LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp,\n rating text NOT NULL,\n image_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n likes varchar NOT NULL,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n parent_id character varying(128),\n description character varying(256),\n views character varying(256) NOT NULL,\n title character varying(256),\n rating varchar,\n tags char NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n country character varying(64) NOT NULL,\n state text NOT NULL,\n operating_hours character varying(64),\n postal_code char,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "List location_id, postal_code, country from groups.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, postal_code, country FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, postal_code, country FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT location_id, postal_code, country FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many messages are there per edited_at?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM socialmedia.messages GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events with amount > 47.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE amount > 47;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE amount > 47 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "What are the updated_at, amount, category of each event?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, amount, category FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, amount, category FROM socialmedia.events WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, amount, category FROM socialmedia.events WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Retrieve cancelled_at, payment_method, payment_status for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_method, payment_status FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_method, payment_status FROM socialmedia.followers WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different approval_status values.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM socialmedia.followers GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Show me title, edited_at, post_id for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT title, edited_at, post_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT title, edited_at, post_id FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with title in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT title, edited_at, post_id FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY title ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "List rating, post_id, text from messages.", "sql": null}, {"role": "assistant", "content": "SELECT rating, post_id, text FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, post_id, text FROM socialmedia.messages ORDER BY title DESC;", "sql": null}, {"role": "user", "content": "Count the number of messages in each post_id category.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY post_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Get post_id, rating, title from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, rating, title FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by rating ascending.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, rating, title FROM socialmedia.messages ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Get max of edited_at by text from messages.", "sql": null}, {"role": "assistant", "content": "SELECT text, MAX(edited_at) AS max_edited_at FROM socialmedia.messages GROUP BY text;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Show me all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by visibility ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY visibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n rating varchar,\n parent_id character varying(256) -- identifier for parent,\n author_id character varying(64),\n subject character varying(128) NOT NULL,\n visibility char,\n likes varchar\n)\n\nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n text text,\n rating text NOT NULL,\n title char\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n payment_status char,\n approval_status character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_method char\n)\n\nCREATE TABLE socialmedia.events (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n debit text,\n amount numeric(38,14),\n category char NOT NULL,\n notes character varying(256),\n currency char\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts with rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE rating LIKE 'A%' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me format, visibility, thumbnail_url, image_url from doctors and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.thumbnail_url, billing.image_url FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Can you order these by visibility ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.thumbnail_url, billing.image_url FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.id ORDER BY visibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me max of author_id grouped by edited_at for departments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, MAX(author_id) AS max_author_id FROM healthcare.departments GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me subject, billin_id, expires_at, thumbnail_url from departments and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.expires_at, billing.thumbnail_url FROM healthcare.departments JOIN healthcare.billing ON departments.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by author_id.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM healthcare.departments GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get departments that match billin_id > 64.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE billin_id > 64;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE billin_id > 64 ORDER BY edited_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "List media_url, views, available from billing.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, views, available FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with tax_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, views, available FROM healthcare.billing ORDER BY tax_rate ASC;", "sql": null}, {"role": "user", "content": "Order the output by thumbnail_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, views, available FROM healthcare.billing ORDER BY thumbnail_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate average of created_at for each thumbnail in departments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, AVERAGE(created_at) AS average_created_at FROM healthcare.departments GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "What are the subject, edited_at, billin_id of each department?", "sql": null}, {"role": "assistant", "content": "SELECT subject, edited_at, billin_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT subject, edited_at, billin_id FROM healthcare.departments WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get average of billin_id by edited_at from departments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, AVERAGE(billin_id) AS average_billin_id FROM healthcare.departments GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get departments that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by subject descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-01-01' ORDER BY subject DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where billin_id > 53.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE billin_id > 53;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE billin_id > 53 ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n thumbnail text,\n author_id char,\n subject text,\n visibility character varying(128),\n billin_id integer NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n available text,\n tax_rate text NOT NULL,\n media_url char,\n thumbnail_url character varying(256) NOT NULL,\n image_url character varying(64) NOT NULL,\n views character varying(256) NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.comment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(comment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at date,\n visibility character varying(128),\n format character varying(256),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n billin_id integer -- reference to billing.id,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (billin_id) REFERENCES billing(id),\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve views, image_url, available for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT views, image_url, available FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT views, image_url, available FROM healthcare.billing ORDER BY available ASC;", "sql": null}, {"role": "user", "content": "Can you order these by available ascending?", "sql": null}, {"role": "assistant", "content": "SELECT views, image_url, available FROM healthcare.billing ORDER BY available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "Get latitude, category, follower_id from all events.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, category, follower_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, category, follower_id FROM socialmedia.events WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me sum of category grouped by follower_id for events.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, SUM(category) AS sum_category FROM socialmedia.events GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "Show me latitude, description, last_inspected for all events.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, description, last_inspected FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, description, last_inspected FROM socialmedia.events WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of events grouped by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM socialmedia.events GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by venue_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE updated_at > '2023-12-01' ORDER BY venue_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me min of description grouped by country for events.", "sql": null}, {"role": "assistant", "content": "SELECT country, MIN(description) AS min_description FROM socialmedia.events GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "What are the country, follower_id, latitude of each event?", "sql": null}, {"role": "assistant", "content": "SELECT country, follower_id, latitude FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by country descending.", "sql": null}, {"role": "assistant", "content": "SELECT country, follower_id, latitude FROM socialmedia.events ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Can you order these by description ascending?", "sql": null}, {"role": "assistant", "content": "SELECT country, follower_id, latitude FROM socialmedia.events ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n content character varying(64) NOT NULL,\n categories text,\n keywords text,\n title varchar NOT NULL,\n body varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n tags varchar NOT NULL,\n shares text,\n body text,\n image_url varchar NOT NULL,\n media_url character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp,\n views character varying(256),\n thumbnail char,\n image_url character varying(64),\n format character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n text text\n)\n\nCREATE TABLE socialmedia.events (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n latitude char,\n country character varying(128),\n category char,\n name char,\n description varchar NOT NULL,\n capacity character varying(256),\n longitude character varying(128),\n follower_id text NOT NULL -- reference to followers.message_id,\n FOREIGN KEY (follower_id) REFERENCES followers(message_id)\n)", "conversations": [{"role": "user", "content": "What are the category, updated_at, description of each event?", "sql": null}, {"role": "assistant", "content": "SELECT category, updated_at, description FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, updated_at, description FROM socialmedia.events ORDER BY country ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT category, updated_at, description FROM socialmedia.events ORDER BY country ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.customers;", "sql": null}, {"role": "user", "content": "List customers that have subscription_id > 9.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.customers WHERE subscription_id > 9;", "sql": null}, {"role": "user", "content": "How many customers are there per profile_picture_url?", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, COUNT(*) AS count FROM banking.customers GROUP BY profile_picture_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Show me count of verification_status grouped by verification_status for subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(verification_status) AS count_verification_status FROM banking.subscriptions GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.customers;", "sql": null}, {"role": "user", "content": "Can you order these by language descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.customers ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Group customers by age and show the max of age.", "sql": null}, {"role": "assistant", "content": "SELECT age, MAX(age) AS max_age FROM banking.customers GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, subtotal, customer_id for every purchase.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, subtotal, customer_id FROM banking.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, subtotal, customer_id FROM banking.purchases WHERE cancelled_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of purchases grouped by status.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM banking.purchases GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "List subtotal, customer_id, exchange_rate from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, customer_id, exchange_rate FROM banking.purchases;", "sql": null}, {"role": "user", "content": "List cancelled_at, exchange_rate, city, subscription_id for each purchase along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, customer_id, exchange_rate, customers.city, customers.subscription_id FROM banking.purchases JOIN banking.customers ON purchases.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, customer_id, exchange_rate, customers.city, customers.subscription_id FROM banking.purchases JOIN banking.customers ON purchases.customer_id = customers.employee_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Get notes, payment_date, city, language by joining subscriptions with customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.city, customers.language FROM banking.subscriptions JOIN banking.customers ON subscriptions.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Group subscriptions by notes and show the max of payment_date.", "sql": null}, {"role": "assistant", "content": "SELECT notes, MAX(payment_date) AS max_payment_date FROM banking.subscriptions GROUP BY notes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Get subscriptions that match customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions WHERE customer_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "List cancelled_at, status, subtotal from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, status, subtotal FROM banking.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, status, subtotal FROM banking.purchases WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up purchases by cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM banking.purchases GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp without time zone,\n city character varying(256),\n age text NOT NULL,\n language character varying(128) NOT NULL,\n profile_picture_url character varying(128),\n subscription_id integer NOT NULL -- reference to subscriptions.transaction_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(transaction_id)\n)\n\nCREATE TABLE banking.subscriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes text,\n exchange_rate varchar,\n verification_status text,\n payee_id char NOT NULL -- identifier for payee,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE banking.purchases (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n status varchar,\n subtotal numeric NOT NULL,\n exchange_rate char,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me exchange_rate, customer_id, verification_status for all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, customer_id, verification_status FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate descending?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, customer_id, verification_status FROM banking.subscriptions ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Group subscriptions by notes and show the sum of notes.", "sql": null}, {"role": "assistant", "content": "SELECT notes, SUM(notes) AS sum_notes FROM banking.subscriptions GROUP BY notes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Retrieve shippin_id, published_at, expires_at for every product.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, published_at, expires_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, published_at, expires_at FROM e-commerce.products ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, published_at, expires_at FROM e-commerce.products ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with shippin_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY shippin_id DESC;", "sql": null}, {"role": "user", "content": "What is the max discount for each image_url in products?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MAX(discount) AS max_discount FROM e-commerce.products GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of discount grouped by media_url for products.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(discount) AS count_discount FROM e-commerce.products GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Show me image_url, expires_at, shippin_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, expires_at, shippin_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, expires_at, shippin_id FROM e-commerce.products WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, expires_at, shippin_id FROM e-commerce.products WHERE image_url LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many products are there per expires_at?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.products GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by shippin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY shippin_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by expires_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by image_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY image_url ASC;", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by discount.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM e-commerce.products GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n media_url character varying(256),\n discount numeric,\n image_url text,\n shippin_id integer -- reference to shipping.post_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n accessibility character varying(256),\n timezone text,\n state text\n)\n\nCREATE TABLE e-commerce.inventory (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n description character varying(128),\n rating character varying(64),\n available char,\n video_url varchar NOT NULL -- identifier for video_url,\n title character varying(64),\n name varchar\n)\n\nCREATE TABLE e-commerce.shipping (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n user_id character varying(128),\n categories character varying(128),\n attachment_url text,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(128) NOT NULL,\n rating char\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up products by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.products GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n status character varying(128) NOT NULL,\n amount decimal,\n description character varying(128),\n payee_id varchar,\n doctor_id text -- reference to doctors.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n rating varchar NOT NULL,\n thumbnail_url character varying(128),\n billin_id text -- reference to billing.transaction_id,\n FOREIGN KEY (billin_id) REFERENCES billing(transaction_id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit,\n language character varying(128) NOT NULL,\n last_name text,\n api_key character varying(256),\n salt char,\n department_id text -- reference to departments.sku,\n FOREIGN KEY (department_id) REFERENCES departments(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n is_verified boolean,\n token text NOT NULL,\n salt char NOT NULL,\n full_name character varying(256),\n department_id text NOT NULL -- reference to departments.sku,\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Can you order these by token descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY token DESC;", "sql": null}, {"role": "user", "content": "Tally up doctors by patient_id.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM healthcare.doctors GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n status character varying(128) NOT NULL,\n amount decimal,\n description character varying(128),\n payee_id varchar,\n doctor_id text -- reference to doctors.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n rating varchar NOT NULL,\n thumbnail_url character varying(128),\n billin_id text -- reference to billing.transaction_id,\n FOREIGN KEY (billin_id) REFERENCES billing(transaction_id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit,\n language character varying(128) NOT NULL,\n last_name text,\n api_key character varying(256),\n salt char,\n department_id text -- reference to departments.sku,\n FOREIGN KEY (department_id) REFERENCES departments(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n is_verified boolean,\n token text NOT NULL,\n salt char NOT NULL,\n full_name character varying(256),\n department_id text NOT NULL -- reference to departments.sku,\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get doctors that match salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up doctors by token.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM healthcare.doctors GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n status character varying(128) NOT NULL,\n amount decimal,\n description character varying(128),\n payee_id varchar,\n doctor_id text -- reference to doctors.user_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n rating varchar NOT NULL,\n thumbnail_url character varying(128),\n billin_id text -- reference to billing.transaction_id,\n FOREIGN KEY (billin_id) REFERENCES billing(transaction_id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit,\n language character varying(128) NOT NULL,\n last_name text,\n api_key character varying(256),\n salt char,\n department_id text -- reference to departments.sku,\n FOREIGN KEY (department_id) REFERENCES departments(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n is_verified boolean,\n token text NOT NULL,\n salt char NOT NULL,\n full_name character varying(256),\n department_id text NOT NULL -- reference to departments.sku,\n patient_id text NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by is_verified descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY is_verified DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve account_id, loan_id, reconciliation_status for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, loan_id, reconciliation_status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get category, reference_number, timezone, account_id by joining audits with loans.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, loan_id, reconciliation_status, loans.timezone, loans.account_id FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.store_id;", "sql": null}, {"role": "user", "content": "Count the number of audits in each reference_number category.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, COUNT(*) AS count FROM finance.audits GROUP BY reference_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me reference_number, account_id, category for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, account_id, category FROM finance.audits;", "sql": null}, {"role": "user", "content": "Arrange the results with category in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, account_id, category FROM finance.audits ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Calculate average of category for each reference_number in audits.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, AVERAGE(category) AS average_category FROM finance.audits GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me last_inspected, account_id, timezone for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, account_id, timezone FROM finance.loans;", "sql": null}, {"role": "user", "content": "Order the output by latitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, account_id, timezone FROM finance.loans ORDER BY latitude ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, account_id, timezone FROM finance.loans ORDER BY latitude ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get latitude, account_id, last_inspected from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, account_id, last_inspected FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, account_id, last_inspected FROM finance.loans WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up loans by longitude.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(*) AS count FROM finance.loans GROUP BY longitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the average category for each reference_number in audits?", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, AVERAGE(category) AS average_category FROM finance.audits GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve account_id, reference_number, latitude, account_id showing the relationship between audits and loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.latitude, loans.account_id FROM finance.audits JOIN finance.loans ON audits.loan_id = loans.store_id;", "sql": null}, {"role": "user", "content": "Group audits by reference_number and show the sum of account_id.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, SUM(account_id) AS sum_account_id FROM finance.audits GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the location_lat, latitude, last_inspected of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, latitude, last_inspected FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve longitude, latitude, due_date, verification_status showing the relationship between loans and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, latitude, last_inspected, accounts.due_date, accounts.verification_status FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, latitude, last_inspected, accounts.due_date, accounts.verification_status FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get loans that match latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE latitude LIKE 'A%' ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the category, loan_id, processed_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT category, loan_id, processed_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits with category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, loan_id, processed_at FROM finance.audits WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with category in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, loan_id, processed_at FROM finance.audits WHERE category LIKE 'A%' ORDER BY category DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n timezone text,\n latitude character varying(128),\n location_lat char NOT NULL,\n longitude character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n category character varying(128),\n reconciliation_status text,\n reference_number character varying(256),\n loan_id text -- reference to loans.store_id,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(store_id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n invoice_number text,\n approval_status char,\n description character varying(128),\n currency varchar,\n payer_id character varying(256) NOT NULL,\n status char NOT NULL,\n verification_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get latitude, timezone, last_inspected from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, timezone, last_inspected FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, timezone, last_inspected FROM finance.loans WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many loans are there per latitude?", "sql": null}, {"role": "assistant", "content": "SELECT latitude, COUNT(*) AS count FROM finance.loans GROUP BY latitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n balance numeric NOT NULL,\n customer_id char -- identifier for customer,\n category character varying(64),\n description character varying(256),\n reconciliation_status character varying(128) NOT NULL,\n notification_id text NOT NULL -- reference to notifications.transaction_id,\n wallet_id text NOT NULL -- reference to wallets.transaction_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n updated_at date,\n customer_id character varying(128),\n discount numeric(38,14),\n approval_status character varying(128),\n subtotal integer,\n quantity varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n balance smallint,\n credit text,\n verification_status character varying(128),\n invoice_number character varying(256) NOT NULL,\n approval_status character varying(256),\n reconciliation_status character varying(128),\n notification_id text -- reference to notifications.transaction_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by reconciliation_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE category LIKE 'A%' ORDER BY reconciliation_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments;", "sql": null}, {"role": "user", "content": "What debit, client_id, created_at, user_id do we have for payments and their associated content?", "sql": null}, {"role": "assistant", "content": "SELECT *, content.created_at, content.user_id FROM insurance.payments JOIN insurance.content ON payments.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "Calculate max of payer_id for each customer_id in payments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(payer_id) AS max_payer_id FROM insurance.payments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Show me account_status, phone, display_name for all clients.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, phone, display_name FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, phone, display_name FROM insurance.clients ORDER BY account_status ASC;", "sql": null}, {"role": "user", "content": "Count the number of clients in each birth_date category.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM insurance.clients GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "List all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Show me clients that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the average conten_id for each conten_id in clients?", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, AVERAGE(conten_id) AS average_conten_id FROM insurance.clients GROUP BY conten_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Get all clients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients WHERE birth_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up clients by conten_id.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, COUNT(*) AS count FROM insurance.clients GROUP BY conten_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by payer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments ORDER BY payer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Display all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.clients ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show me min of birth_date grouped by birth_date for clients.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, MIN(birth_date) AS min_birth_date FROM insurance.clients GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments WHERE payment_date >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by invoice_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.payments WHERE payment_date >= CURRENT_DATE - INTERVAL '7 days' ORDER BY invoice_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, birth_date, account_status for all clients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, birth_date, account_status FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Get clients that match birth_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, birth_date, account_status FROM insurance.clients WHERE birth_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the count display_name for each display_name in clients?", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(display_name) AS count_display_name FROM insurance.clients GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve birth_date, account_status, last_active for every client.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, account_status, last_active FROM insurance.clients;", "sql": null}, {"role": "user", "content": "Retrieve clients where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, account_status, last_active FROM insurance.clients WHERE birth_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, account_status, last_active FROM insurance.clients WHERE birth_date = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.content (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n thumbnail character varying(256) NOT NULL,\n body char,\n visibility char NOT NULL,\n user_id character varying(128) -- identifier for user,\n score text,\n views character varying(256)\n)\n\nCREATE TABLE insurance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n customer_id character varying(128) -- identifier for customer,\n notes text NOT NULL,\n payer_id varchar -- identifier for payer,\n approval_status character varying(256) NOT NULL,\n description character varying(128),\n debit character varying(64) NOT NULL,\n conten_id integer -- reference to content.content_id,\n client_id text NOT NULL -- reference to clients.id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id),\n FOREIGN KEY (client_id) REFERENCES clients(id)\n)\n\nCREATE TABLE insurance.clients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp,\n account_status text NOT NULL,\n phone varchar,\n display_name char NOT NULL,\n birth_date timestamp without time zone,\n conten_id integer NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)", "conversations": [{"role": "user", "content": "What are the payer_id, customer_id, debit of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, customer_id, debit FROM insurance.payments;", "sql": null}, {"role": "user", "content": "Find payments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, customer_id, debit FROM insurance.payments WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, customer_id, debit FROM insurance.payments WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months' ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n cost numeric,\n image_url character varying(64) NOT NULL,\n currency character varying(256) NOT NULL,\n subcategory varchar,\n tax_rate text,\n featured_rank varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n message character varying(128),\n format text,\n keywords character varying(64),\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.categories (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n backorder character varying(256) NOT NULL,\n cost numeric,\n thumbnail_url character varying(256),\n quantity character varying(128)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency text,\n payment_method character varying(64),\n status character varying(128),\n discount numeric,\n customer_id character varying(128) NOT NULL,\n approval_status character varying(64),\n quantity character varying(128),\n categorie_id text NOT NULL -- reference to categories.item_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(item_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up orders by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM e-commerce.orders GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n cost numeric,\n image_url character varying(64) NOT NULL,\n currency character varying(256) NOT NULL,\n subcategory varchar,\n tax_rate text,\n featured_rank varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n message character varying(128),\n format text,\n keywords character varying(64),\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.categories (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n backorder character varying(256) NOT NULL,\n cost numeric,\n thumbnail_url character varying(256),\n quantity character varying(128)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency text,\n payment_method character varying(64),\n status character varying(128),\n discount numeric,\n customer_id character varying(128) NOT NULL,\n approval_status character varying(64),\n quantity character varying(128),\n categorie_id text NOT NULL -- reference to categories.item_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(item_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "What is the min order_id for each keywords in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT keywords, MIN(order_id) AS min_order_id FROM e-commerce.order_items GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n cost numeric,\n image_url character varying(64) NOT NULL,\n currency character varying(256) NOT NULL,\n subcategory varchar,\n tax_rate text,\n featured_rank varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n message character varying(128),\n format text,\n keywords character varying(64),\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.categories (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n backorder character varying(256) NOT NULL,\n cost numeric,\n thumbnail_url character varying(256),\n quantity character varying(128)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency text,\n payment_method character varying(64),\n status character varying(128),\n discount numeric,\n customer_id character varying(128) NOT NULL,\n approval_status character varying(64),\n quantity character varying(128),\n categorie_id text NOT NULL -- reference to categories.item_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(item_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List discount, currency, quantity from orders.", "sql": null}, {"role": "assistant", "content": "SELECT discount, currency, quantity FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT discount, currency, quantity FROM e-commerce.orders WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT discount, currency, quantity FROM e-commerce.orders WHERE created_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n cost numeric,\n image_url character varying(64) NOT NULL,\n currency character varying(256) NOT NULL,\n subcategory varchar,\n tax_rate text,\n featured_rank varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n message character varying(128),\n format text,\n keywords character varying(64),\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.categories (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n backorder character varying(256) NOT NULL,\n cost numeric,\n thumbnail_url character varying(256),\n quantity character varying(128)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency text,\n payment_method character varying(64),\n status character varying(128),\n discount numeric,\n customer_id character varying(128) NOT NULL,\n approval_status character varying(64),\n quantity character varying(128),\n categorie_id text NOT NULL -- reference to categories.item_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(item_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE created_at > '2023-01-01' ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n cost numeric,\n image_url character varying(64) NOT NULL,\n currency character varying(256) NOT NULL,\n subcategory varchar,\n tax_rate text,\n featured_rank varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n message character varying(128),\n format text,\n keywords character varying(64),\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.categories (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n backorder character varying(256) NOT NULL,\n cost numeric,\n thumbnail_url character varying(256),\n quantity character varying(128)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n currency text,\n payment_method character varying(64),\n status character varying(128),\n discount numeric,\n customer_id character varying(128) NOT NULL,\n approval_status character varying(64),\n quantity character varying(128),\n categorie_id text NOT NULL -- reference to categories.item_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(item_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show the results sorted by message descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY message DESC;", "sql": null}, {"role": "user", "content": "Sort the results by message ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY message ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Show me payment_method, created_at, amount for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, created_at, amount FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, created_at, amount FROM finance.transactions ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by created_at for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(created_at) AS max_created_at FROM finance.transactions GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get delivery_status, customer_id, created_at from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, customer_id, created_at FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, customer_id, created_at FROM finance.transactions ORDER BY quantity DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, customer_id, created_at FROM finance.transactions ORDER BY quantity DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_method ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by zip_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Can you order these by status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "What are the joined_at, zip_code, status of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, zip_code, status FROM finance.customers;", "sql": null}, {"role": "user", "content": "What transaction_id, last_name, payment_method, delivery_status do we have for customers and their associated transactions?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, zip_code, status, transactions.payment_method, transactions.delivery_status FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.id;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.customers GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "What quantity, created_at, zip_code, avatar do we have for transactions and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.zip_code, customers.avatar FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.person_id;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.zip_code, customers.avatar FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.person_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the average updated_at for each updated_at in customers?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(updated_at) AS average_updated_at FROM finance.customers GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List customer_id, created_at, card_type from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, card_type FROM finance.transactions;", "sql": null}, {"role": "user", "content": "What amount, card_type, avatar, status do we have for transactions and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, card_type, customers.avatar, customers.status FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.person_id;", "sql": null}, {"role": "user", "content": "What is the min created_at for each amount in transactions?", "sql": null}, {"role": "assistant", "content": "SELECT amount, MIN(created_at) AS min_created_at FROM finance.transactions GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n amount smallint,\n delivery_status character varying(64),\n quantity text,\n card_type character varying(128),\n payment_method char NOT NULL,\n customer_id text NOT NULL -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n age character varying(128),\n status character varying(64) NOT NULL,\n zip_code char,\n last_name char,\n avatar char,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, last_name, transaction_id for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_name, transaction_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_name, transaction_id FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_name, transaction_id FROM finance.customers WHERE joined_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "What are the exchange_rate, prescription_id, processed_at of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, prescription_id, processed_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get all billing created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, prescription_id, processed_at FROM healthcare.billing WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, prescription_id, processed_at FROM healthcare.billing WHERE processed_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Order the output by billin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY billin_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by thumbnail_url.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "What are the subtotal, processed_at, prescription_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, processed_at, prescription_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, processed_at, prescription_id FROM healthcare.billing WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of billing grouped by subtotal.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM healthcare.billing GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, backorder, thumbnail_url of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, thumbnail_url FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve expires_at, tax_rate, subtotal, prescription_id showing the relationship between prescriptions and billing.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, thumbnail_url, billing.subtotal, billing.prescription_id FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.invoice_id;", "sql": null}, {"role": "user", "content": "How many prescriptions are there per tax_rate?", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY tax_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by expires_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "What is the min thumbnail_url for each billin_id in prescriptions?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, MIN(thumbnail_url) AS min_thumbnail_url FROM healthcare.prescriptions GROUP BY billin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate sum of prescription_id for each prescription_id in billing.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, SUM(prescription_id) AS sum_prescription_id FROM healthcare.billing GROUP BY prescription_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing with prescription_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE prescription_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE prescription_id LIKE 'A%' ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by thumbnail_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY thumbnail_url ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different thumbnail_url values.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Show me subtotal, processed_at, exchange_rate for all billing.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, processed_at, exchange_rate FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, processed_at, exchange_rate FROM healthcare.billing WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, processed_at, exchange_rate FROM healthcare.billing WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n tax_rate character varying(256) NOT NULL,\n backorder character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n billin_id text -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)\n\nCREATE TABLE healthcare.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n subtotal numeric,\n exchange_rate character varying(256),\n prescription_id text NOT NULL -- reference to prescriptions.item_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List prescriptions that have billin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE billin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE billin_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get profile_picture_url, username, joined_at from all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, username, joined_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, username, joined_at FROM e-commerce.order_items WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many order_items are there per joined_at?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM e-commerce.order_items GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, person_id, birth_date for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, person_id, birth_date FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Sort the results by person_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, person_id, birth_date FROM e-commerce.categories ORDER BY person_id ASC;", "sql": null}, {"role": "user", "content": "How many categories are there per membership_level?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, COUNT(*) AS count FROM e-commerce.categories GROUP BY membership_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "List user_id, display_name, joined_at from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, display_name, joined_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items with display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, display_name, joined_at FROM e-commerce.order_items WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of profile_picture_url by user_id from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(profile_picture_url) AS average_profile_picture_url FROM e-commerce.order_items GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, profile_picture_url, display_name for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, profile_picture_url, display_name FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, profile_picture_url, display_name FROM e-commerce.order_items WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM e-commerce.order_items GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE birth_date >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many categories are there per city?", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM e-commerce.categories GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me age, person_id, city for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT age, person_id, city FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve categories where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT age, person_id, city FROM e-commerce.categories WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get count of membership_level by person_id from categories.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, COUNT(membership_level) AS count_membership_level FROM e-commerce.categories GROUP BY person_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "List username, display_name, joined_at from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT username, display_name, joined_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT username, display_name, joined_at FROM e-commerce.order_items WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with display_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT username, display_name, joined_at FROM e-commerce.order_items WHERE joined_at > '2023-01-01' ORDER BY display_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with profile_picture_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY profile_picture_url ASC;", "sql": null}, {"role": "user", "content": "Calculate min of user_id for each profile_picture_url in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, MIN(user_id) AS min_user_id FROM e-commerce.order_items GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, gender, profile_picture_url for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, gender, profile_picture_url FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, gender, profile_picture_url FROM e-commerce.order_items WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Order the output by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, gender, profile_picture_url FROM e-commerce.order_items WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n age character varying(128),\n birth_date timestamp without time zone,\n city text,\n membership_level char,\n status char\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username text,\n profile_picture_url character varying(128),\n gender text,\n display_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "List status, person_id, birth_date from categories.", "sql": null}, {"role": "assistant", "content": "SELECT status, person_id, birth_date FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT status, person_id, birth_date FROM e-commerce.categories WHERE birth_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT status, person_id, birth_date FROM e-commerce.categories WHERE birth_date = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Order the output by enrollment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY enrollment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me manufacturer, title, course_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, title, course_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, title, course_id FROM education.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me min of title grouped by created_at for departments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(title) AS min_title FROM education.departments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve category, customer_id, invoice_number for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT category, customer_id, invoice_number FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, customer_id, invoice_number FROM education.grades WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many grades are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM education.grades GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where course_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE course_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of course_id grouped by manufacturer for departments.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, SUM(course_id) AS sum_course_id FROM education.departments GROUP BY manufacturer;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get created_at, backorder, manufacturer from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, manufacturer FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, manufacturer FROM education.departments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, manufacturer FROM education.departments WHERE created_at > '2023-12-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the enrollment_id, invoice_number, updated_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, invoice_number, updated_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, invoice_number, updated_at FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, invoice_number, updated_at FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY customer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve customer_id, updated_at, enrollment_id for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, enrollment_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, enrollment_id FROM education.grades WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, enrollment_id FROM education.grades WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve enrollment_id, category, updated_at for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, category, updated_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with invoice_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, category, updated_at FROM education.grades WHERE invoice_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, category, updated_at FROM education.grades WHERE invoice_number LIKE 'A%' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve category, invoice_number, enrollment_id for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT category, invoice_number, enrollment_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT category, invoice_number, enrollment_id FROM education.grades WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different enrollment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, COUNT(*) AS count FROM education.grades GROUP BY enrollment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n category char,\n invoice_number character varying(128) NOT NULL,\n customer_id character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.payment_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(payment_id)\n)\n\nCREATE TABLE education.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n manufacturer text,\n backorder character varying(128) NOT NULL,\n title varchar,\n course_id text NOT NULL -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n manufacturer character varying(64),\n quantity character varying(128),\n popularity_score character varying(128) NOT NULL,\n cost numeric(38,14)\n)\n\nCREATE TABLE education.enrollments (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at date,\n subtotal numeric(38,14) NOT NULL,\n card_type character varying(128),\n fee character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get password_hash, message_id, age from all users.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, message_id, age FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, message_id, age FROM socialmedia.users WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group users by profile_picture_url and show the sum of customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, SUM(customer_id) AS sum_customer_id FROM socialmedia.users GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, password_hash, is_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, password_hash, is_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, password_hash, is_active FROM socialmedia.users WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, password_hash, is_active FROM socialmedia.users WHERE is_active = TRUE LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List is_active, customer_id, age from users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, customer_id, age FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, customer_id, age FROM socialmedia.users ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Tally up users by age.", "sql": null}, {"role": "assistant", "content": "SELECT age, COUNT(*) AS count FROM socialmedia.users GROUP BY age ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users where email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of email grouped by profile_picture_url for users.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, AVERAGE(email) AS average_email FROM socialmedia.users GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me count of email grouped by is_active for users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(email) AS count_email FROM socialmedia.users GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the message_id, password_hash, email of each user?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, password_hash, email FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by age ascending?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, password_hash, email FROM socialmedia.users ORDER BY age ASC;", "sql": null}, {"role": "user", "content": "Show me count of created_at grouped by age for users.", "sql": null}, {"role": "assistant", "content": "SELECT age, COUNT(created_at) AS count_created_at FROM socialmedia.users GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List updated_at, is_active, customer_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, customer_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, customer_id FROM socialmedia.users WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, is_active, customer_id FROM socialmedia.users WHERE updated_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up users by message_id.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.users GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, customer_id, age for every user.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, customer_id, age FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users with profile_picture_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, customer_id, age FROM socialmedia.users WHERE profile_picture_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up users by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.users GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp,\n email varchar,\n age character varying(128) NOT NULL,\n password_hash varchar,\n is_active boolean,\n profile_picture_url char,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n body character varying(128),\n text char NOT NULL,\n attachment_url character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me profile_picture_url, message_id, customer_id for all users.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, message_id, customer_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with email in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, message_id, customer_id FROM socialmedia.users ORDER BY email ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different profile_picture_url values.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, COUNT(*) AS count FROM socialmedia.users GROUP BY profile_picture_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by shares descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE published_at > '2023-12-01' ORDER BY shares DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Retrieve due_date, payee_id, account_id for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payee_id, account_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payee_id, account_id FROM socialmedia.followers WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payee_id, account_id FROM socialmedia.followers WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Show me token, salt, last_name for all users.", "sql": null}, {"role": "assistant", "content": "SELECT token, salt, last_name FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by first_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT token, salt, last_name FROM socialmedia.users ORDER BY first_name ASC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT token, salt, last_name FROM socialmedia.users ORDER BY first_name ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List comment_id, salt, message, published_at for each user along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.message, comments.published_at FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.id;", "sql": null}, {"role": "user", "content": "Tally up users by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.users GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List user_id, reference_number, comment_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, reference_number, comment_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get all followers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, reference_number, comment_id FROM socialmedia.followers WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with reference_number in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, reference_number, comment_id FROM socialmedia.followers WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY reference_number DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List updated_at, comment_id, city from users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, comment_id, city FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users where first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, comment_id, city FROM socialmedia.users WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by first_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, comment_id, city FROM socialmedia.users WHERE first_name LIKE 'A%' ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List comment_id, city, joined_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, city, joined_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, city, joined_at FROM socialmedia.users WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with last_name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, city, joined_at FROM socialmedia.users WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY last_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by payee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY payee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show me min of city grouped by joined_at for users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MIN(city) AS min_city FROM socialmedia.users GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n parent_id varchar,\n shares varchar,\n message character varying(128),\n visibility character varying(128),\n body text,\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n first_name character varying(256),\n last_name character varying(128) NOT NULL,\n salt varchar NOT NULL,\n token char,\n city char,\n comment_id text -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.followers (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number varchar,\n payee_id character varying(256),\n comment_id text -- reference to comments.id,\n user_id text -- reference to users.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (user_id) REFERENCES users(id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by parent_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY parent_id DESC;", "sql": null}, {"role": "user", "content": "Tally up comments by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the count updated_at for each longitude in billing?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(updated_at) AS count_updated_at FROM healthcare.billing GROUP BY longitude;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of billing grouped by patient_id.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM healthcare.billing GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "What are the longitude, patient_id, updated_at of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, patient_id, updated_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Order the output by accessibility descending.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, patient_id, updated_at FROM healthcare.billing ORDER BY accessibility DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, patient_id, updated_at FROM healthcare.billing ORDER BY accessibility DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, account_status, password_hash for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_status, password_hash FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_status, password_hash FROM healthcare.medical_records ORDER BY username ASC;", "sql": null}, {"role": "user", "content": "What is the max id for each created_at in medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(id) AS max_id FROM healthcare.medical_records GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "What are the password_hash, id, created_at of each medical_record?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, id, created_at FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, id, created_at FROM healthcare.medical_records ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of account_status for each timezone in medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, SUM(account_status) AS sum_account_status FROM healthcare.medical_records GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List accessibility, description, longitude from billing.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, description, longitude FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Order the output by postal_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, description, longitude FROM healthcare.billing ORDER BY postal_code ASC;", "sql": null}, {"role": "user", "content": "Count the number of billing in each accessibility category.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM healthcare.billing GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List display_name, updated_at, last_active from patients.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, updated_at, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT display_name, updated_at, last_active FROM healthcare.patients ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, updated_at, last_active FROM healthcare.patients ORDER BY last_active ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY timezone DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of medical_records across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n longitude character varying(256),\n description character varying(128) NOT NULL,\n postal_code varchar NOT NULL,\n accessibility char NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.departments (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp without time zone,\n currency char,\n price numeric(38,14) NOT NULL,\n views character varying(128)\n)\n\nCREATE TABLE healthcare.medical_records (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n phone character varying(128),\n timezone character varying(256) NOT NULL,\n account_status text,\n username varchar NOT NULL,\n password_hash text NOT NULL,\n is_verified bit -- indicates if verified is true,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at date,\n avatar text,\n display_name char NOT NULL,\n last_name char,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Get description, longitude, postal_code from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT description, longitude, postal_code FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where patient_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, longitude, postal_code FROM healthcare.billing WHERE patient_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of accessibility for each accessibility in billing.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, MAX(accessibility) AS max_accessibility FROM healthcare.billing GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, discount, available of each asset?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, discount, available FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve user_id, media_url, birth_date, created_at showing the relationship between assets and users.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, discount, available, users.birth_date, users.created_at FROM tradingplatform.assets JOIN tradingplatform.users ON assets.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Show me the count of assets grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE birth_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get average of created_at by birth_date from users.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, AVERAGE(created_at) AS average_created_at FROM tradingplatform.users GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where user_id > 34.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE user_id > 34;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE user_id > 34 ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve discount, title, popularity_score for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT discount, title, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get assets that match user_id > 94.", "sql": null}, {"role": "assistant", "content": "SELECT discount, title, popularity_score FROM tradingplatform.assets WHERE user_id > 94;", "sql": null}, {"role": "user", "content": "How many assets are there per media_url?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM tradingplatform.assets GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve available, user_id, media_url for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT available, user_id, media_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What user_id, created_at, salt, created_at do we have for assets and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT available, user_id, media_url, users.salt, users.created_at FROM tradingplatform.assets JOIN tradingplatform.users ON assets.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Show me the count of assets grouped by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM tradingplatform.assets GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "List discount, created_at, popularity_score from assets.", "sql": null}, {"role": "assistant", "content": "SELECT discount, created_at, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT discount, created_at, popularity_score FROM tradingplatform.assets ORDER BY title DESC;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT discount, created_at, popularity_score FROM tradingplatform.assets ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve salt, birth_date, created_at, popularity_score showing the relationship between users and assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.created_at, assets.popularity_score FROM tradingplatform.users JOIN tradingplatform.assets ON users.asset_id = assets.item_id;", "sql": null}, {"role": "user", "content": "Count the number of users in each country category.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM tradingplatform.users GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE birth_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many users are there per first_name?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get country, first_name, created_at from all users.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, created_at FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, created_at FROM tradingplatform.users WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT country, first_name, created_at FROM tradingplatform.users WHERE country LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n birth_date date NOT NULL,\n salt character varying(256),\n first_name character varying(64),\n country char NOT NULL,\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n title character varying(128),\n available char,\n media_url text,\n popularity_score varchar,\n discount integer,\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Show me first_name, salt, birth_date for all users.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, salt, birth_date FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, salt, birth_date FROM tradingplatform.users WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many users are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.users GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve birth_date, joined_at, is_active for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, joined_at, is_active FROM travel.customers;", "sql": null}, {"role": "user", "content": "Can you order these by last_active descending?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, joined_at, is_active FROM travel.customers ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show me count of joined_at grouped by token for customers.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(joined_at) AS count_joined_at FROM travel.customers GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Get booking_id, last_active, birth_date from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, last_active, birth_date FROM travel.customers;", "sql": null}, {"role": "user", "content": "Order the output by booking_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, last_active, birth_date FROM travel.customers ORDER BY booking_id ASC;", "sql": null}, {"role": "user", "content": "Tally up customers by last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM travel.customers GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers;", "sql": null}, {"role": "user", "content": "Find customers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, token, is_active for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, token, is_active FROM travel.customers;", "sql": null}, {"role": "user", "content": "Find customers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, token, is_active FROM travel.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different token values.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM travel.customers GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers;", "sql": null}, {"role": "user", "content": "Find customers where booking_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers WHERE booking_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers WHERE booking_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "List birth_date, is_active, token from customers.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, is_active, token FROM travel.customers;", "sql": null}, {"role": "user", "content": "What joined_at, last_active, created_at, currency do we have for customers and their associated bookings?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, is_active, token, bookings.created_at, bookings.currency FROM travel.customers JOIN travel.bookings ON customers.booking_id = bookings.payment_id;", "sql": null}, {"role": "user", "content": "Can you order these by booking_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, is_active, token, bookings.created_at, bookings.currency FROM travel.customers JOIN travel.bookings ON customers.booking_id = bookings.payment_id ORDER BY booking_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me token, is_active, booking_id for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT token, is_active, booking_id FROM travel.customers;", "sql": null}, {"role": "user", "content": "List customers that have is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT token, is_active, booking_id FROM travel.customers WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Arrange the results with booking_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT token, is_active, booking_id FROM travel.customers WHERE is_active = TRUE ORDER BY booking_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers;", "sql": null}, {"role": "user", "content": "Show me joined_at, birth_date, card_type, currency from customers and their related bookings.", "sql": null}, {"role": "assistant", "content": "SELECT *, bookings.card_type, bookings.currency FROM travel.customers JOIN travel.bookings ON customers.booking_id = bookings.payment_id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, bookings.card_type, bookings.currency FROM travel.customers JOIN travel.bookings ON customers.booking_id = bookings.payment_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "List is_active, birth_date, joined_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, birth_date, joined_at FROM travel.customers;", "sql": null}, {"role": "user", "content": "Order the output by token descending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, birth_date, joined_at FROM travel.customers ORDER BY token DESC;", "sql": null}, {"role": "user", "content": "Show me max of last_active grouped by token for customers.", "sql": null}, {"role": "assistant", "content": "SELECT token, MAX(last_active) AS max_last_active FROM travel.customers GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.bookings (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n card_type character varying(256),\n user_id character varying(256) NOT NULL,\n currency text NOT NULL\n)\n\nCREATE TABLE travel.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n geo_point character varying(128),\n city varchar,\n name character varying(128),\n postal_code char\n)\n\nCREATE TABLE travel.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n last_active date,\n token character varying(256),\n is_active bit NOT NULL -- indicates if active is true,\n birth_date timestamp NOT NULL,\n booking_id text -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.customers WHERE last_active > '2023-12-01';", "sql": null}, {"role": "user", "content": "Group customers by birth_date and show the count of last_active.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(last_active) AS count_last_active FROM travel.customers GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve timezone, city, bio for every user.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, city, bio FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, city, bio FROM e-commerce.users WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate max of timezone for each updated_at in users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(timezone) AS max_timezone FROM e-commerce.users GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me city, bio, updated_at for all users.", "sql": null}, {"role": "assistant", "content": "SELECT city, bio, updated_at FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT city, bio, updated_at FROM e-commerce.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of users in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.users GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, city, timezone from all users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, timezone FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get all users created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, timezone FROM e-commerce.users WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me min of timezone grouped by bio for users.", "sql": null}, {"role": "assistant", "content": "SELECT bio, MIN(timezone) AS min_timezone FROM e-commerce.users GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by city descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY city DESC;", "sql": null}, {"role": "user", "content": "Can you order these by review_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY review_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "List timezone, review_id, image_url, edited_at for each user along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.image_url, reviews.edited_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.image_url, reviews.edited_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me joined_at, city, timezone for all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, timezone FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, timezone FROM e-commerce.users WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, timezone FROM e-commerce.users WHERE updated_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get sum of review_id by timezone from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, SUM(review_id) AS sum_review_id FROM e-commerce.users GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me joined_at, city, updated_at for all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, updated_at FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me bio, updated_at, message, edited_at from users and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, updated_at, reviews.message, reviews.edited_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, updated_at, reviews.message, reviews.edited_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, city, review_id for all users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, review_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve review_id, timezone, image_url, published_at showing the relationship between users and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, review_id, reviews.image_url, reviews.published_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, review_id, reviews.image_url, reviews.published_at FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at timestamp without time zone,\n message character varying(256),\n image_url text NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n media_url text,\n stock_level varchar,\n price bigint NOT NULL,\n tax_rate char,\n rating character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at timestamp,\n bio char,\n timezone character varying(64) NOT NULL,\n city character varying(64),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, bio, review_id for every user.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, bio, review_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "List review_id, updated_at, edited_at, message for each user along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, bio, review_id, reviews.edited_at, reviews.message FROM e-commerce.users JOIN e-commerce.reviews ON users.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different timezone values.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM e-commerce.users GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, address_line1, id for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, address_line1, id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, address_line1, id FROM socialmedia.followers WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me count of event_id grouped by capacity for followers.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(event_id) AS count_event_id FROM socialmedia.followers GROUP BY capacity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me event_id, coordinates, api_key, last_active from followers and their related events.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.api_key, events.last_active FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.customer_id;", "sql": null}, {"role": "user", "content": "How many followers are there per event_id?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY event_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Get updated_at, coordinates, geo_point from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, coordinates, geo_point FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by address_line1 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, coordinates, geo_point FROM socialmedia.followers ORDER BY address_line1 ASC;", "sql": null}, {"role": "user", "content": "Show me max of coordinates grouped by address_line1 for followers.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, MAX(coordinates) AS max_coordinates FROM socialmedia.followers GROUP BY address_line1;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by coordinates ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY coordinates ASC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where event_id > 10.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE event_id > 10;", "sql": null}, {"role": "user", "content": "Show me average of id grouped by event_id for followers.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, AVERAGE(id) AS average_id FROM socialmedia.followers GROUP BY event_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected > '2023-01-01' ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Get coordinates, capacity, updated_at from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, capacity, updated_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What last_inspected, address_line1, username, last_name do we have for followers and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, capacity, updated_at, events.username, events.last_name FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.customer_id;", "sql": null}, {"role": "user", "content": "Arrange the results with last_inspected in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, capacity, updated_at, events.username, events.last_name FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.customer_id ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "List geo_point, coordinates, address_line1 from followers.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, coordinates, address_line1 FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, coordinates, address_line1 FROM socialmedia.followers ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, coordinates, address_line1 FROM socialmedia.followers ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n customer_id varchar -- identifier for customer,\n approval_status character varying(64) NOT NULL,\n product_id varchar NOT NULL,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n payment_status character varying(128)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n capacity char NOT NULL,\n coordinates character varying(128),\n geo_point char,\n address_line1 character varying(64),\n event_id integer NOT NULL -- reference to events.customer_id,\n FOREIGN KEY (event_id) REFERENCES events(customer_id)\n)\n\nCREATE TABLE socialmedia.events (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n api_key character varying(128) NOT NULL,\n bio varchar,\n username varchar,\n last_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get min of id by coordinates from followers.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, MIN(id) AS min_id FROM socialmedia.followers GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the user_id, joined_at, account_status of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, joined_at, account_status FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, joined_at, account_status FROM healthcare.doctors WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group doctors by account_status and show the average of joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, AVERAGE(joined_at) AS average_joined_at FROM healthcare.doctors GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the sum avatar for each account_status in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT account_status, SUM(avatar) AS sum_avatar FROM healthcare.doctors GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get doctors that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of doctors grouped by department_id.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, COUNT(*) AS count FROM healthcare.doctors GROUP BY department_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with account_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY account_status ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve department_id, user_id, avatar for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, user_id, avatar FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get user_id, avatar, name, zip_code by joining doctors with departments.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, user_id, avatar, departments.name, departments.zip_code FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.store_id;", "sql": null}, {"role": "user", "content": "Sort the results by department_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, user_id, avatar, departments.name, departments.zip_code FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.store_id ORDER BY department_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me account_status, status, department_id for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, department_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, department_id FROM healthcare.doctors ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, department_id FROM healthcare.doctors ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many doctors are there per user_id?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM healthcare.doctors GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the account_status, status, user_id of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, user_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with department_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, user_id FROM healthcare.doctors WHERE department_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, user_id FROM healthcare.doctors WHERE department_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve account_status, status, last_inspected, description showing the relationship between doctors and departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.last_inspected, departments.description FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.store_id;", "sql": null}, {"role": "user", "content": "Can you order these by account_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.last_inspected, departments.description FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.store_id ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n user_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n status character varying(64) NOT NULL,\n account_status character varying(128),\n department_id text NOT NULL -- reference to departments.store_id,\n FOREIGN KEY (department_id) REFERENCES departments(store_id)\n)\n\nCREATE TABLE healthcare.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n parking_available text,\n description char,\n zip_code character varying(64),\n name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY account_status DESC;", "sql": null}, {"role": "user", "content": "Sort the results by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many orders are there per cancelled_at?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with currency in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY currency ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, cancelled_at, payment_status for every log.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, cancelled_at, payment_status FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs with order_id > 47.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, cancelled_at, payment_status FROM tradingplatform.logs WHERE order_id > 47;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, cancelled_at, payment_status FROM tradingplatform.logs WHERE order_id > 47 LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many orders are there per log_id?", "sql": null}, {"role": "assistant", "content": "SELECT log_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY log_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me payment_status, log_id, quantity for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, log_id, quantity FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, log_id, quantity FROM tradingplatform.orders WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, log_id, quantity FROM tradingplatform.orders WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_status character varying(256),\n exchange_rate varchar NOT NULL,\n approval_status char NOT NULL,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n payment_method character varying(64),\n currency varchar NOT NULL,\n subtotal smallint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n quantity char NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n log_id text NOT NULL -- reference to logs.payment_id,\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n total integer NOT NULL,\n payment_method varchar,\n exchange_rate character varying(256) NOT NULL,\n amount decimal,\n user_id character varying(64) -- identifier for user,\n order_id integer NOT NULL -- reference to orders.transaction_id,\n log_id text -- reference to logs.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id),\n FOREIGN KEY (log_id) REFERENCES logs(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve payment_method, currency, product_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, product_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, product_id FROM tradingplatform.orders ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "Can you order these by product_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, product_id FROM tradingplatform.orders ORDER BY product_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "What are the image_url, purchase_id, tax_rate of each product?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, purchase_id, tax_rate FROM inventory.products;", "sql": null}, {"role": "user", "content": "Get all products from last week.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, purchase_id, tax_rate FROM inventory.products WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by title descending?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, purchase_id, tax_rate FROM inventory.products WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "Show me title, tax_rate, image_url for all products.", "sql": null}, {"role": "assistant", "content": "SELECT title, tax_rate, image_url FROM inventory.products;", "sql": null}, {"role": "user", "content": "Get products that match tax_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT title, tax_rate, image_url FROM inventory.products WHERE tax_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of products in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM inventory.products GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of products in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM inventory.products GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "What are the account_id, card_type, delivery_status of each purchase?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, delivery_status FROM inventory.purchases;", "sql": null}, {"role": "user", "content": "Find purchases where delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, delivery_status FROM inventory.purchases WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by fee ascending.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, delivery_status FROM inventory.purchases WHERE delivery_status LIKE 'A%' ORDER BY fee ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.purchases;", "sql": null}, {"role": "user", "content": "Show the results sorted by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.purchases ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Count the number of purchases in each payment_method category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM inventory.purchases GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products ORDER BY updated_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products;", "sql": null}, {"role": "user", "content": "List products that have title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of updated_at by purchase_id from products.", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, SUM(updated_at) AS sum_updated_at FROM inventory.products GROUP BY purchase_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.products;", "sql": null}, {"role": "user", "content": "What image_url, purchase_id, card_type, product_id do we have for products and their associated purchases?", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.card_type, purchases.product_id FROM inventory.products JOIN inventory.purchases ON products.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Group products by tax_rate and show the count of tax_rate.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, COUNT(tax_rate) AS count_tax_rate FROM inventory.products GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "List all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.purchases;", "sql": null}, {"role": "user", "content": "Retrieve delivery_status, exchange_rate, image_url, title showing the relationship between purchases and products.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.image_url, products.title FROM inventory.purchases JOIN inventory.products ON purchases.product_id = products.product_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.image_url, products.title FROM inventory.purchases JOIN inventory.products ON purchases.product_id = products.product_id ORDER BY account_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.products (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n title character varying(256) NOT NULL,\n image_url varchar,\n tax_rate text,\n purchase_id text NOT NULL -- reference to purchases.transaction_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(transaction_id)\n)\n\nCREATE TABLE inventory.purchases (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n fee varchar,\n payment_method char,\n card_type character varying(256),\n delivery_status character varying(256),\n account_id character varying(128),\n exchange_rate text,\n product_id text NOT NULL -- reference to products.product_id,\n FOREIGN KEY (product_id) REFERENCES products(product_id)\n)", "conversations": [{"role": "user", "content": "Get title, updated_at, purchase_id from all products.", "sql": null}, {"role": "assistant", "content": "SELECT title, updated_at, purchase_id FROM inventory.products;", "sql": null}, {"role": "user", "content": "Show me updated_at, tax_rate, card_type, delivery_status from products and their related purchases.", "sql": null}, {"role": "assistant", "content": "SELECT title, updated_at, purchase_id, purchases.card_type, purchases.delivery_status FROM inventory.products JOIN inventory.purchases ON products.purchase_id = purchases.transaction_id;", "sql": null}, {"role": "user", "content": "Can you order these by image_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT title, updated_at, purchase_id, purchases.card_type, purchases.delivery_status FROM inventory.products JOIN inventory.purchases ON products.purchase_id = purchases.transaction_id ORDER BY image_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by title ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with message_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Get content, format, title from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT content, format, title FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts that have title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT content, format, title FROM socialmedia.posts WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with format in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT content, format, title FROM socialmedia.posts WHERE title LIKE 'A%' ORDER BY format ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me visibility, title, published_at for all posts.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, title, published_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Arrange the results with format in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, title, published_at FROM socialmedia.posts ORDER BY format ASC;", "sql": null}, {"role": "user", "content": "Show me the count of posts grouped by title.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM socialmedia.posts GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get published_at, title, reply_to_id, subject by joining posts with messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.reply_to_id, messages.subject FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Show me the count of posts grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM socialmedia.posts GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts with content LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE content LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different format values.", "sql": null}, {"role": "assistant", "content": "SELECT format, COUNT(*) AS count FROM socialmedia.posts GROUP BY format ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Get published_at, format, content from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, format, content FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, format, content FROM socialmedia.posts WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of published_at grouped by visibility for posts.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, AVERAGE(published_at) AS average_published_at FROM socialmedia.posts GROUP BY visibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Arrange the results with title in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY title DESC;", "sql": null}, {"role": "user", "content": "Get average of visibility by visibility from posts.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, AVERAGE(visibility) AS average_visibility FROM socialmedia.posts GROUP BY visibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different format values.", "sql": null}, {"role": "assistant", "content": "SELECT format, COUNT(*) AS count FROM socialmedia.posts GROUP BY format ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "List published_at, message_id, title from posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message_id, title FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List title, format, reply_to_id, subject for each post along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message_id, title, messages.reply_to_id, messages.subject FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Order the output by content descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message_id, title, messages.reply_to_id, messages.subject FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.post_id ORDER BY content DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n format character varying(128),\n visibility text,\n content character varying(256),\n title char NOT NULL,\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE socialmedia.messages (\n post_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(128),\n subject character varying(256),\n title character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "What visibility, message_id, subject, created_at do we have for posts and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.subject, messages.created_at FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.subject, messages.created_at FROM socialmedia.posts JOIN socialmedia.messages ON posts.message_id = messages.post_id ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, appointment_id, score, user_id showing the relationship between billing and appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.score, appointments.user_id FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id;", "sql": null}, {"role": "user", "content": "Order the output by operating_hours descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.score, appointments.user_id FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id ORDER BY operating_hours DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with appointment_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY appointment_id ASC;", "sql": null}, {"role": "user", "content": "Calculate min of operating_hours for each appointment_id in billing.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, MIN(operating_hours) AS min_operating_hours FROM healthcare.billing GROUP BY appointment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE timezone LIKE 'A%' ORDER BY parking_available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE operating_hours LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Retrieve operating_hours, address_line2, appointment_id for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, appointment_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, appointment_id FROM healthcare.billing WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, appointment_id FROM healthcare.billing WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Order the output by appointment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY appointment_id DESC;", "sql": null}, {"role": "user", "content": "Show me max of updated_at grouped by timezone for billing.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MAX(updated_at) AS max_updated_at FROM healthcare.billing GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "What are the updated_at, address_id, parking_available of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, parking_available, media_url, edited_at showing the relationship between billing and appointments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available, appointments.media_url, appointments.edited_at FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id;", "sql": null}, {"role": "user", "content": "Can you order these by address_line2 descending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available, appointments.media_url, appointments.edited_at FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id ORDER BY address_line2 DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "List parking_available, address_line2, appointment_id from billing.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, address_line2, appointment_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where appointment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, address_line2, appointment_id FROM healthcare.billing WHERE appointment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, address_line2, appointment_id FROM healthcare.billing WHERE appointment_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Get operating_hours, parking_available, address_id from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, parking_available, address_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get timezone, address_id, published_at, tags by joining billing with appointments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, parking_available, address_id, appointments.published_at, appointments.tags FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id;", "sql": null}, {"role": "user", "content": "Arrange the results with operating_hours in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, parking_available, address_id, appointments.published_at, appointments.tags FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.post_id ORDER BY operating_hours DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n parking_available text NOT NULL,\n timezone character varying(256),\n address_line2 character varying(128),\n operating_hours varchar NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n user_id character varying(256),\n tags varchar,\n score character varying(128),\n media_url character varying(64),\n rating char\n)", "conversations": [{"role": "user", "content": "Get operating_hours, timezone, address_line2 from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, timezone, address_line2 FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, timezone, address_line2 FROM healthcare.billing ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Group billing by address_id and show the average of parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, AVERAGE(parking_available) AS average_parking_available FROM healthcare.billing GROUP BY address_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY username ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of events across different street values.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM socialmedia.events GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "List last_inspected, latitude, post_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, latitude, post_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, latitude, post_id FROM socialmedia.events WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate sum of latitude for each updated_at in events.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(latitude) AS sum_latitude FROM socialmedia.events GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events with post_id > 39.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE post_id > 39;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE post_id > 39 LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "What are the like_id, bio, is_verified of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, bio, is_verified FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by is_verified ascending.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, bio, is_verified FROM socialmedia.followers ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of email for each username in followers.", "sql": null}, {"role": "assistant", "content": "SELECT username, SUM(email) AS sum_email FROM socialmedia.followers GROUP BY username;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of followers in each bio category.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM socialmedia.followers GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "What are the address_line1, latitude, post_id of each event?", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, latitude, post_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Can you order these by post_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, latitude, post_id FROM socialmedia.events ORDER BY post_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, latitude, post_id FROM socialmedia.events ORDER BY post_id DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "List post_id, address_line1, updated_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, address_line1, updated_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get updated_at, post_id, rating, text by joining events with posts.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, address_line1, updated_at, posts.rating, posts.text FROM socialmedia.events JOIN socialmedia.posts ON events.post_id = posts.post_id;", "sql": null}, {"role": "user", "content": "Show me the count of events grouped by street.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM socialmedia.events GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "Get bio, username, like_id from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT bio, username, like_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by like_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT bio, username, like_id FROM socialmedia.followers ORDER BY like_id DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT bio, username, like_id FROM socialmedia.followers ORDER BY like_id DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n email character varying(256) NOT NULL,\n birth_date timestamp NOT NULL,\n username character varying(128),\n bio text,\n is_verified boolean NOT NULL -- indicates if verified is true,\n like_id integer NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n author_id text -- identifier for author,\n rating char,\n text varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n likes varchar,\n thumbnail character varying(256),\n user_id char,\n format varchar,\n views varchar\n)\n\nCREATE TABLE socialmedia.events (\n store_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp without time zone,\n address_line1 character varying(128) NOT NULL,\n street varchar,\n latitude char NOT NULL,\n post_id integer -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, post_id, address_line1 of each event?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, post_id, address_line1 FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Arrange the results with last_inspected in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, post_id, address_line1 FROM socialmedia.events ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Tally up events by address_line1.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, COUNT(*) AS count FROM socialmedia.events GROUP BY address_line1 ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "List all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "List location_lat, address_id, processed_at, account_id for each facilitie along with their reservation information.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.account_id FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.account_id FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Get all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "What created_at, postal_code, processed_at, user_id do we have for facilities and their associated reservations?", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.user_id FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by reservation_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.user_id FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id ORDER BY reservation_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Get all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Retrieve location_lat, created_at, tax, fee showing the relationship between facilities and reservations.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.tax, reservations.fee FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Calculate count of zip_code for each street in facilities.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(zip_code) AS count_zip_code FROM travel.facilities GROUP BY street;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "List all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Get all facilities from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE last_inspected >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up facilities by street.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM travel.facilities GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Show the results sorted by zip_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Can you order these by reservation_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities ORDER BY reservation_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Retrieve facilities where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up facilities by reservation_id.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, COUNT(*) AS count FROM travel.facilities GROUP BY reservation_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "List street, postal_code, address_id from facilities.", "sql": null}, {"role": "assistant", "content": "SELECT street, postal_code, address_id FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Find facilities where street LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT street, postal_code, address_id FROM travel.facilities WHERE street LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by location_lat for facilities.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, MAX(created_at) AS max_created_at FROM travel.facilities GROUP BY location_lat;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Get all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "List created_at, postal_code, processed_at, traded_at for each facilitie along with their reservation information.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.traded_at FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.processed_at, reservations.traded_at FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, reservation_id, zip_code from all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, reservation_id, zip_code FROM travel.facilities;", "sql": null}, {"role": "user", "content": "What address_id, operating_hours, tax, account_id do we have for facilities and their associated reservations?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, reservation_id, zip_code, reservations.tax, reservations.account_id FROM travel.facilities JOIN travel.reservations ON facilities.reservation_id = reservations.order_id;", "sql": null}, {"role": "user", "content": "Get the distribution of facilities across different street values.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM travel.facilities GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.reservations (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n account_id character varying(256),\n tax decimal NOT NULL,\n user_id character varying(256) -- identifier for user,\n fee character varying(64)\n)\n\nCREATE TABLE travel.employees (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n is_active boolean NOT NULL -- indicates if active is true,\n membership_level character varying(256),\n phone char,\n gender character varying(128)\n)\n\nCREATE TABLE travel.facilities (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n created_at date,\n postal_code character varying(128),\n street character varying(128),\n location_lat character varying(128) NOT NULL,\n zip_code varchar,\n operating_hours char NOT NULL,\n address_line2 character varying(128),\n reservation_id integer -- reference to reservations.order_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(order_id)\n)", "conversations": [{"role": "user", "content": "Display all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Show me facilities with last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities WHERE last_inspected > '2023-01-01' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Retrieve all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content;", "sql": null}, {"role": "user", "content": "List text, attachment_url, user_id, fee for each content along with their reservation information.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.user_id, reservations.fee FROM music.content JOIN music.reservations ON content.reservation_id = reservations.invoice_id;", "sql": null}, {"role": "user", "content": "Show me the count of content grouped by reservation_id.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, COUNT(*) AS count FROM music.content GROUP BY reservation_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Show me all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "Can you order these by buyer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations ORDER BY buyer_id ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations ORDER BY buyer_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Show me all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content;", "sql": null}, {"role": "user", "content": "Show me content with edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of content across different text values.", "sql": null}, {"role": "assistant", "content": "SELECT text, COUNT(*) AS count FROM music.content GROUP BY text ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Retrieve all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content;", "sql": null}, {"role": "user", "content": "Get attachment_url, categories, approval_status, created_at by joining content with reservations.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.approval_status, reservations.created_at FROM music.content JOIN music.reservations ON content.reservation_id = reservations.invoice_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by text descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.approval_status, reservations.created_at FROM music.content JOIN music.reservations ON content.reservation_id = reservations.invoice_id ORDER BY text DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Get shares, categories, reservation_id from all content.", "sql": null}, {"role": "assistant", "content": "SELECT shares, categories, reservation_id FROM music.content;", "sql": null}, {"role": "user", "content": "Get reservation_id, edited_at, cancelled_at, fee by joining content with reservations.", "sql": null}, {"role": "assistant", "content": "SELECT shares, categories, reservation_id, reservations.cancelled_at, reservations.fee FROM music.content JOIN music.reservations ON content.reservation_id = reservations.invoice_id;", "sql": null}, {"role": "user", "content": "Show me min of categories grouped by attachment_url for content.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, MIN(categories) AS min_categories FROM music.content GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "What are the conten_id, buyer_id, user_id of each reservation?", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, buyer_id, user_id FROM music.reservations;", "sql": null}, {"role": "user", "content": "Find reservations created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, buyer_id, user_id FROM music.reservations WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, buyer_id, user_id FROM music.reservations WHERE created_at > '2023-12-01' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Retrieve cancelled_at, created_at, approval_status for every reservation.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, created_at, approval_status FROM music.reservations;", "sql": null}, {"role": "user", "content": "Sort the results by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, created_at, approval_status FROM music.reservations ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Calculate average of buyer_id for each buyer_id in reservations.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, AVERAGE(buyer_id) AS average_buyer_id FROM music.reservations GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Retrieve shares, edited_at, attachment_url for every content.", "sql": null}, {"role": "assistant", "content": "SELECT shares, edited_at, attachment_url FROM music.content;", "sql": null}, {"role": "user", "content": "Show the results sorted by attachment_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT shares, edited_at, attachment_url FROM music.content ORDER BY attachment_url ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by attachment_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT shares, edited_at, attachment_url FROM music.content ORDER BY attachment_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "What are the cancelled_at, fee, approval_status of each reservation?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, fee, approval_status FROM music.reservations;", "sql": null}, {"role": "user", "content": "List reservations that have buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, fee, approval_status FROM music.reservations WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of reservations across different cancelled_at values.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM music.reservations GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n cancelled_at timestamp,\n buyer_id varchar,\n approval_status varchar,\n fee varchar,\n user_id char -- identifier for user,\n conten_id text -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE music.content (\n id text PRIMARY KEY -- unique identifier,\n edited_at date,\n attachment_url character varying(256),\n categories char NOT NULL,\n shares character varying(256),\n text text,\n keywords character varying(128),\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id)\n)\n\nCREATE TABLE music.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n api_key varchar,\n last_login timestamp,\n last_name character varying(128) NOT NULL,\n email varchar,\n timezone char\n)", "conversations": [{"role": "user", "content": "Retrieve all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content;", "sql": null}, {"role": "user", "content": "Arrange the results with attachment_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.content ORDER BY attachment_url DESC;", "sql": null}, {"role": "user", "content": "Tally up content by edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM music.content GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List traded_at, tax, payment_method from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, tax, payment_method FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get teachers that match product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, tax, payment_method FROM education.teachers WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by grade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, tax, payment_method FROM education.teachers WHERE product_id LIKE 'A%' ORDER BY grade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get teachers that match traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of teachers grouped by tax.", "sql": null}, {"role": "assistant", "content": "SELECT tax, COUNT(*) AS count FROM education.teachers GROUP BY tax ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "What are the payment_method, traded_at, transaction_id of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, transaction_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "List product_id, transaction_id, brand, expires_at for each teacher along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, transaction_id, grades.brand, grades.expires_at FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, transaction_id, grades.brand, grades.expires_at FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve payment_method, traded_at, grade_id for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, grade_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get teachers that match transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, grade_id FROM education.teachers WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by traded_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, grade_id FROM education.teachers WHERE transaction_id LIKE 'A%' ORDER BY traded_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve grade_id, transaction_id, payment_method for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, transaction_id, payment_method FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get all teachers created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, transaction_id, payment_method FROM education.teachers WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the min product_id for each transaction_id in teachers?", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, MIN(product_id) AS min_product_id FROM education.teachers GROUP BY transaction_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get payment_method, tax, grade_id from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, tax, grade_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, tax, grade_id FROM education.teachers WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of teachers in each transaction_id category.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM education.teachers GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me payment_method, product_id, grade_id for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, product_id, grade_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "List tax, payment_method, tax_rate, brand for each teacher along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, product_id, grade_id, grades.tax_rate, grades.brand FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by grade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, product_id, grade_id, grades.tax_rate, grades.brand FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.id ORDER BY grade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Arrange the results with traded_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY traded_at DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY traded_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n credit character varying(256),\n category character varying(64)\n)\n\nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n expires_at date,\n tax_rate character varying(128),\n available char NOT NULL,\n brand character varying(256)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n tax numeric,\n payment_method char,\n product_id text NOT NULL,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "What are the traded_at, product_id, grade_id of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, product_id, grade_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve transaction_id, product_id, tax_rate, brand showing the relationship between teachers and grades.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, product_id, grade_id, grades.tax_rate, grades.brand FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Get average of product_id by transaction_id from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, AVERAGE(product_id) AS average_product_id FROM education.teachers GROUP BY transaction_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY payment_method ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Order the output by traded_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY traded_at DESC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY traded_at DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get orders that match traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with order_item_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE traded_at > '2023-01-01' ORDER BY order_item_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get order_item_id, total, subtotal from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, total, subtotal FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by order_item_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, total, subtotal FROM e-commerce.orders ORDER BY order_item_id DESC;", "sql": null}, {"role": "user", "content": "How many orders are there per subtotal?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM e-commerce.orders GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List payment_method, customer_id, exchange_rate from orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, customer_id, exchange_rate FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, customer_id, exchange_rate FROM e-commerce.orders WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate count of exchange_rate for each payment_method in orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(exchange_rate) AS count_exchange_rate FROM e-commerce.orders GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve order_item_id, customer_id, timezone, capacity showing the relationship between orders and order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.timezone, order_items.capacity FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Arrange the results with traded_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.timezone, order_items.capacity FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id ORDER BY traded_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the exchange_rate, card_type, order_item_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, order_item_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get total, traded_at, last_inspected, name by joining orders with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, order_item_id, order_items.last_inspected, order_items.name FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, card_type, order_item_id, order_items.last_inspected, order_items.name FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get payment_method, traded_at, updated_at, capacity by joining orders with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.updated_at, order_items.capacity FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.updated_at, order_items.capacity FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve order_item_id, payment_method, card_type for every order.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, payment_method, card_type FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me customer_id, subtotal, parking_available, updated_at from orders and their related order_items.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, payment_method, card_type, order_items.parking_available, order_items.updated_at FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Order the output by total ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, payment_method, card_type, order_items.parking_available, order_items.updated_at FROM e-commerce.orders JOIN e-commerce.order_items ON orders.order_item_id = order_items.store_id ORDER BY total ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n exchange_rate character varying(64) NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n card_type varchar,\n total integer NOT NULL,\n payment_method character varying(128),\n subtotal numeric,\n order_item_id integer -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n parking_available character varying(128),\n capacity varchar,\n name character varying(256),\n timezone character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up orders by card_type.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM e-commerce.orders GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "Can you order these by cost descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY cost DESC;", "sql": null}, {"role": "user", "content": "Order the output by cost ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY cost ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "What are the is_active, good_id, profile_picture_url of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, good_id, profile_picture_url FROM government.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, good_id, profile_picture_url FROM government.customers ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by timezone descending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, good_id, profile_picture_url FROM government.customers ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "List goods that have expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods WHERE expires_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.customers;", "sql": null}, {"role": "user", "content": "List customers that have good_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.customers WHERE good_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of timezone grouped by gender for customers.", "sql": null}, {"role": "assistant", "content": "SELECT gender, AVERAGE(timezone) AS average_timezone FROM government.customers GROUP BY gender;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List timezone, is_active, good_id from customers.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, is_active, good_id FROM government.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, is_active, good_id FROM government.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by profile_picture_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, is_active, good_id FROM government.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY profile_picture_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "What are the cost, title, published_at of each good?", "sql": null}, {"role": "assistant", "content": "SELECT cost, title, published_at FROM government.goods;", "sql": null}, {"role": "user", "content": "Show me goods that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT cost, title, published_at FROM government.goods WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of goods grouped by price.", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM government.goods GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get published_at, expires_at, price from all goods.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, price FROM government.goods;", "sql": null}, {"role": "user", "content": "Show the results sorted by cost ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, price FROM government.goods ORDER BY cost ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of goods across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM government.goods GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "Sort the results by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY description ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get customer_id, expires_at, description from all goods.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, expires_at, description FROM government.goods;", "sql": null}, {"role": "user", "content": "Retrieve title, cost, profile_picture_url, status showing the relationship between goods and customers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, expires_at, description, customers.profile_picture_url, customers.status FROM government.goods JOIN government.customers ON goods.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Get the distribution of goods across different expires_at values.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM government.goods GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.customers (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n gender char,\n profile_picture_url char NOT NULL,\n timezone character varying(128) NOT NULL,\n status char,\n is_active bit NOT NULL -- indicates if active is true,\n last_name character varying(128),\n good_id text -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE government.goods (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n cost numeric,\n description character varying(128),\n price smallint,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "Show me goods with cost > 35.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods WHERE cost > 35;", "sql": null}, {"role": "user", "content": "How many goods are there per title?", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM government.goods GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans that have approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE approval_status LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "What are the reconciliation_status, amount, customer_id of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, amount, customer_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with amount > 66.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, amount, customer_id FROM finance.loans WHERE amount > 66;", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different transaction_id values.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM finance.loans GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate max of email for each last_login in customers.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, MAX(email) AS max_email FROM finance.customers GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, processed_at, reconciliation_status for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, reconciliation_status FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get loans that match amount > 63.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, reconciliation_status FROM finance.loans WHERE amount > 63;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, reconciliation_status FROM finance.loans WHERE amount > 63 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get loans that match vendor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE vendor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE vendor_id LIKE 'A%' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "List updated_at, last_login, is_active from customers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_login, is_active FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with phone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_login, is_active FROM finance.customers WHERE phone LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max joined_at for each password_hash in customers?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, MAX(joined_at) AS max_joined_at FROM finance.customers GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of loans in each customer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.loans GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "Show me status, reconciliation_status, processed_at for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT status, reconciliation_status, processed_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where vendor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, reconciliation_status, processed_at FROM finance.loans WHERE vendor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max vendor_id for each processed_at in loans?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MAX(vendor_id) AS max_vendor_id FROM finance.loans GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp,\n nationality character varying(256),\n email character varying(128),\n membership_level character varying(128) NOT NULL,\n is_active bit -- indicates if active is true,\n last_login timestamp NOT NULL,\n phone char,\n password_hash character varying(128)\n)\n\nCREATE TABLE finance.loans (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status varchar,\n customer_id character varying(128) NOT NULL -- identifier for customer,\n approval_status char,\n amount numeric(38,14),\n vendor_id character varying(64),\n reconciliation_status varchar\n)", "conversations": [{"role": "user", "content": "List joined_at, is_active, nationality from customers.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, is_active, nationality FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers from last week.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, is_active, nationality FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by password_hash descending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, is_active, nationality FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY password_hash DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me sum of price grouped by status for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT status, SUM(price) AS sum_price FROM restaurant.transactions GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions WHERE updated_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles;", "sql": null}, {"role": "user", "content": "List articles that have shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles WHERE shares LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions WHERE buyer_id LIKE 'A%' ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles;", "sql": null}, {"role": "user", "content": "Sort the results by body descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles ORDER BY body DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles ORDER BY body DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n updated_at timestamp without time zone,\n price numeric(38,14),\n buyer_id char -- identifier for buyer,\n approval_status character varying(128),\n status varchar,\n user_id character varying(64),\n article_id integer -- reference to articles.message_id,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.articles (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at date,\n edited_at timestamp,\n image_url text NOT NULL,\n body character varying(64),\n shares varchar,\n merchandis_id text -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE restaurant.merchandise (\n id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp without time zone,\n tax_rate character varying(64),\n rating varchar,\n media_url text,\n popularity_score character varying(128),\n article_id integer -- reference to articles.message_id,\n transaction_id integer -- reference to transactions.invoice_id,\n FOREIGN KEY (article_id) REFERENCES articles(message_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles;", "sql": null}, {"role": "user", "content": "Get all articles from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of customers in each full_name category.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM finance.customers GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the website, city, full_name of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT website, city, full_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me joined_at, city, updated_at, parent_id from customers and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT website, city, full_name, loans.updated_at, loans.parent_id FROM finance.customers JOIN finance.loans ON customers.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Tally up customers by id.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM finance.customers GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the city, website, full_name of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT city, website, full_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Order the output by display_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT city, website, full_name FROM finance.customers ORDER BY display_name ASC;", "sql": null}, {"role": "user", "content": "Tally up customers by salt.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM finance.customers GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, last_name, last_active for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, last_name, last_active FROM finance.customers;", "sql": null}, {"role": "user", "content": "Order the output by salt ascending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, last_name, last_active FROM finance.customers ORDER BY salt ASC;", "sql": null}, {"role": "user", "content": "Tally up customers by city.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM finance.customers GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve website, salt, last_name for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT website, salt, last_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Order the output by display_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT website, salt, last_name FROM finance.customers ORDER BY display_name ASC;", "sql": null}, {"role": "user", "content": "Count the number of customers in each salt category.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM finance.customers GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve id, last_name, joined_at for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT id, last_name, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where loan_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, last_name, joined_at FROM finance.customers WHERE loan_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT id, last_name, joined_at FROM finance.customers WHERE loan_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List last_name, display_name, views, parent_id for each customer along with their loan information.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.views, loans.parent_id FROM finance.customers JOIN finance.loans ON customers.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "How many customers are there per joined_at?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM finance.customers GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the joined_at, city, id of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, id FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers that have display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, id FROM finance.customers WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, id FROM finance.customers WHERE display_name LIKE 'A%' ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the website, salt, city of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT website, salt, city FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT website, salt, city FROM finance.customers WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the sum loan_id for each loan_id in customers?", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, SUM(loan_id) AS sum_loan_id FROM finance.customers GROUP BY loan_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n joined_at timestamp without time zone,\n city char,\n salt character varying(256) NOT NULL,\n last_name character varying(64) NOT NULL,\n website varchar,\n full_name text NOT NULL,\n display_name text,\n loan_id text NOT NULL -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n views character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n title character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve id, display_name, salt for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT id, display_name, salt FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with display_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT id, display_name, salt FROM finance.customers ORDER BY display_name ASC;", "sql": null}, {"role": "user", "content": "How many customers are there per last_name?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, COUNT(*) AS count FROM finance.customers GROUP BY last_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products where item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE item_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List name, item_id, order_id from products.", "sql": null}, {"role": "assistant", "content": "SELECT name, item_id, order_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, item_id, order_id FROM e-commerce.products WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT name, item_id, order_id FROM e-commerce.products WHERE media_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, COUNT(*) AS count FROM e-commerce.products GROUP BY stock_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the order_id, media_url, stock_level of each product?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, media_url, stock_level FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, media_url, stock_level FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group products by published_at and show the count of item_id.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(item_id) AS count_item_id FROM e-commerce.products GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products where stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average item_id for each published_at in products?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, AVERAGE(item_id) AS average_item_id FROM e-commerce.products GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me order_id, name, stock_level for all products.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, name, stock_level FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, name, stock_level FROM e-commerce.products WHERE item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max published_at for each media_url in products?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MAX(published_at) AS max_published_at FROM e-commerce.products GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me item_id, name, processed_at, subtotal from products and their related orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.processed_at, orders.subtotal FROM e-commerce.products JOIN e-commerce.orders ON products.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Group products by media_url and show the sum of stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, SUM(stock_level) AS sum_stock_level FROM e-commerce.products GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get order_id, name, media_url from all products.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, name, media_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, name, media_url FROM e-commerce.products WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by order_id.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(*) AS count FROM e-commerce.products GROUP BY order_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n name char,\n media_url text,\n stock_level varchar NOT NULL,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate character varying(128),\n delivery_status text,\n discount decimal,\n subtotal numeric,\n approval_status character varying(128),\n status varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE name LIKE 'A%' ORDER BY name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve first_name, doctor_id, birth_date for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, doctor_id, birth_date FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get city, salt, quantity, amount by joining patients with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, doctor_id, birth_date, doctors.quantity, doctors.amount FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "Count the number of patients in each city category.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM healthcare.patients GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me prescription_id, currency, amount for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, currency, amount FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where prescription_id > 1.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, currency, amount FROM healthcare.doctors WHERE prescription_id > 1;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, currency, amount FROM healthcare.doctors WHERE prescription_id > 1 LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "List cancelled_at, quantity, currency from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, quantity, currency FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, quantity, currency FROM healthcare.doctors WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by cancelled_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, quantity, currency FROM healthcare.doctors WHERE cancelled_at > '2023-12-01' ORDER BY cancelled_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Get last_active, first_name, doctor_id from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, first_name, doctor_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by doctor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, first_name, doctor_id FROM healthcare.patients ORDER BY doctor_id DESC;", "sql": null}, {"role": "user", "content": "Get sum of bio by bio from patients.", "sql": null}, {"role": "assistant", "content": "SELECT bio, SUM(bio) AS sum_bio FROM healthcare.patients GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by prescription_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY prescription_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY prescription_id ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve bio, doctor_id, cancelled_at, quantity showing the relationship between patients and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.cancelled_at, doctors.quantity FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.id;", "sql": null}, {"role": "user", "content": "Group patients by last_active and show the min of bio.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, MIN(bio) AS min_bio FROM healthcare.patients GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Get invoice_number, payment_date, patient_id from all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, payment_date, patient_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, payment_date, patient_id FROM healthcare.prescriptions WHERE due_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by verification_status.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the status, salt, website of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT status, salt, website FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match bio LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, salt, website FROM healthcare.patients WHERE bio LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT status, salt, website FROM healthcare.patients WHERE bio LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128) NOT NULL,\n first_name text,\n birth_date date NOT NULL,\n bio text NOT NULL,\n salt char NOT NULL,\n city character varying(256) NOT NULL,\n website char,\n doctor_id text NOT NULL -- reference to doctors.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(id)\n)\n\nCREATE TABLE healthcare.doctors (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n quantity char NOT NULL,\n currency character varying(256),\n amount smallint,\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date date,\n verification_status character varying(128),\n payer_id text,\n approval_status character varying(128),\n invoice_number character varying(256),\n balance bigint,\n patient_id text -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Get salt, first_name, bio from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, bio FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by salt ascending.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, bio FROM healthcare.patients ORDER BY salt ASC;", "sql": null}, {"role": "user", "content": "Order the output by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, bio FROM healthcare.patients ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.merchandise;", "sql": null}, {"role": "user", "content": "Get merchandise that match media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.merchandise WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.merchandise WHERE media_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by merchandis_id.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, COUNT(*) AS count FROM manufacturing.messages GROUP BY merchandis_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages WHERE edited_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get count of merchandis_id by description from messages.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(merchandis_id) AS count_merchandis_id FROM manufacturing.messages GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail_url, message_id, featured_rank for every merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, message_id, featured_rank FROM manufacturing.merchandise;", "sql": null}, {"role": "user", "content": "What updated_at, reserved, tags, description do we have for merchandise and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, message_id, featured_rank, messages.tags, messages.description FROM manufacturing.merchandise JOIN manufacturing.messages ON merchandise.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, message_id, featured_rank, messages.tags, messages.description FROM manufacturing.merchandise JOIN manufacturing.messages ON merchandise.message_id = messages.message_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "List edited_at, description, thumbnail_url, video_url for each message along with their merchandise information.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.thumbnail_url, merchandise.video_url FROM manufacturing.messages JOIN manufacturing.merchandise ON messages.merchandis_id = merchandise.product_id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.thumbnail_url, merchandise.video_url FROM manufacturing.messages JOIN manufacturing.merchandise ON messages.merchandis_id = merchandise.product_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get description, tags, merchandis_id from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT description, tags, merchandis_id FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, tags, merchandis_id FROM manufacturing.messages ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different edited_at values.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM manufacturing.messages GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages ORDER BY edited_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "List merchandis_id, edited_at, media_url, subcategory for each message along with their merchandise information.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.media_url, merchandise.subcategory FROM manufacturing.messages JOIN manufacturing.merchandise ON messages.merchandis_id = merchandise.product_id;", "sql": null}, {"role": "user", "content": "Calculate max of tags for each views in messages.", "sql": null}, {"role": "assistant", "content": "SELECT views, MAX(tags) AS max_tags FROM manufacturing.messages GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve tags, description, edited_at for every message.", "sql": null}, {"role": "assistant", "content": "SELECT tags, description, edited_at FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT tags, description, edited_at FROM manufacturing.messages ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT tags, description, edited_at FROM manufacturing.messages ORDER BY description ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.messages (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n views varchar,\n description varchar NOT NULL,\n merchandis_id integer -- reference to merchandise.product_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(product_id)\n)\n\nCREATE TABLE manufacturing.merchandise (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views character varying(256) NOT NULL,\n featured_rank character varying(128),\n video_url character varying(256),\n thumbnail_url text,\n subcategory character varying(256) NOT NULL,\n reserved char,\n media_url character varying(256) NOT NULL,\n message_id integer -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.messages;", "sql": null}, {"role": "user", "content": "Show me merchandis_id, views, media_url, thumbnail_url from messages and their related merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.media_url, merchandise.thumbnail_url FROM manufacturing.messages JOIN manufacturing.merchandise ON messages.merchandis_id = merchandise.product_id;", "sql": null}, {"role": "user", "content": "Sort the results by tags descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.media_url, merchandise.thumbnail_url FROM manufacturing.messages JOIN manufacturing.merchandise ON messages.merchandis_id = merchandise.product_id ORDER BY tags DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List last_inspected, message_id, created_at, edited_at for each follower along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.created_at, messages.edited_at FROM socialmedia.followers JOIN socialmedia.messages ON followers.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Group followers by category and show the count of type.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(type) AS count_type FROM socialmedia.followers GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Show me description, category, state for all followers.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, state FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where coordinates LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, state FROM socialmedia.followers WHERE coordinates LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of category grouped by accessibility for followers.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, MAX(category) AS max_category FROM socialmedia.followers GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the average message_id for each coordinates in followers?", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, AVERAGE(message_id) AS average_message_id FROM socialmedia.followers GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Show me message_id, last_inspected, state for all followers.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, last_inspected, state FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with description in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, last_inspected, state FROM socialmedia.followers ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with accessibility in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, last_inspected, state FROM socialmedia.followers ORDER BY accessibility DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get message_id, category, subject, created_at by joining followers with messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.subject, messages.created_at FROM socialmedia.followers JOIN socialmedia.messages ON followers.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Group followers by last_inspected and show the count of category.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(category) AS count_category FROM socialmedia.followers GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY accessibility ASC;", "sql": null}, {"role": "user", "content": "Count the number of followers in each type category.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM socialmedia.followers GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me description, accessibility, edited_at, subject from followers and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.edited_at, messages.subject FROM socialmedia.followers JOIN socialmedia.messages ON followers.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.edited_at, messages.subject FROM socialmedia.followers JOIN socialmedia.messages ON followers.message_id = messages.message_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "List category, message_id, state from followers.", "sql": null}, {"role": "assistant", "content": "SELECT category, message_id, state FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me coordinates, description, thumbnail, image_url from followers and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT category, message_id, state, messages.thumbnail, messages.image_url FROM socialmedia.followers JOIN socialmedia.messages ON followers.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Get max of type by message_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, MAX(type) AS max_type FROM socialmedia.followers GROUP BY message_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n type varchar NOT NULL,\n description varchar NOT NULL,\n category character varying(256),\n state character varying(64),\n coordinates char,\n accessibility varchar NOT NULL,\n message_id text -- reference to messages.message_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)\n\nCREATE TABLE socialmedia.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n language character varying(128),\n full_name char,\n avatar character varying(256) NOT NULL,\n city character varying(64),\n age varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp,\n subject character varying(256) NOT NULL,\n thumbnail character varying(256),\n image_url varchar\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY description DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "List all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up shipping by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Order the output by thumbnail ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY thumbnail ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY thumbnail ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE format LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with review_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY review_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with reply_to_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY reply_to_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by published_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE format LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text character varying(256),\n rating character varying(256),\n attachment_url char,\n shares char,\n user_id character varying(128) -- identifier for user,\n format character varying(256) NOT NULL,\n product_id text -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.reviews (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n thumbnail character varying(256) NOT NULL,\n rating character varying(256),\n image_url varchar,\n user_id character varying(64) -- identifier for user,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)\n\nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n video_url character varying(128),\n image_url varchar,\n thumbnail_url character varying(64),\n price numeric,\n reserved varchar,\n msrp character varying(256) NOT NULL,\n currency character varying(256),\n review_id text -- reference to reviews.post_id,\n shippin_id text NOT NULL -- reference to shipping.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id),\n FOREIGN KEY (shippin_id) REFERENCES shipping(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE product_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List amount, processed_at, thumbnail_url, tax_rate for each department along with their course information.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.thumbnail_url, courses.tax_rate FROM education.departments JOIN education.courses ON departments.course_id = courses.product_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.thumbnail_url, courses.tax_rate FROM education.departments JOIN education.courses ON departments.course_id = courses.product_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve currency, processed_at, price, tax_rate showing the relationship between departments and courses.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.price, courses.tax_rate FROM education.departments JOIN education.courses ON departments.course_id = courses.product_id;", "sql": null}, {"role": "user", "content": "Order the output by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.price, courses.tax_rate FROM education.departments JOIN education.courses ON departments.course_id = courses.product_id ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve course_id, processed_at, user_id for every department.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, processed_at, user_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with currency in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, processed_at, user_id FROM education.departments ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "How many departments are there per currency?", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM education.departments GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, customer_id, payment_id for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, customer_id, payment_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by reconciliation_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, customer_id, payment_id FROM education.enrollments ORDER BY reconciliation_status DESC;", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.enrollments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve currency, processed_at, course_id for every department.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, course_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with processed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, course_id FROM education.departments ORDER BY processed_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, course_id FROM education.departments ORDER BY processed_at DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up departments by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.departments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me course_id, amount, currency for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, amount, currency FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, amount, currency FROM education.departments WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by processed_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT course_id, amount, currency FROM education.departments WHERE processed_at > '2023-01-01' ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me user_id, department_id, payment_id for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, department_id, payment_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments where reconciliation_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, department_id, payment_id FROM education.enrollments WHERE reconciliation_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up enrollments by reconciliation_status.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, COUNT(*) AS count FROM education.enrollments GROUP BY reconciliation_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Get all departments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by user_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE processed_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id text,\n currency text NOT NULL,\n amount numeric NOT NULL,\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)\n\nCREATE TABLE education.enrollments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n user_id character varying(128),\n customer_id character varying(64) NOT NULL,\n reconciliation_status character varying(256),\n department_id text NOT NULL -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n created_at timestamp,\n price integer,\n manufacturer character varying(64),\n thumbnail_url varchar,\n tax_rate character varying(256),\n media_url text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get created_at, reconciliation_status, payment_id from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, reconciliation_status, payment_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments where customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, reconciliation_status, payment_id FROM education.enrollments WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, reconciliation_status, payment_id FROM education.enrollments WHERE customer_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Show me doctor_id, user_id, card_type for all billing.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, user_id, card_type FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where amount > 48.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, user_id, card_type FROM healthcare.billing WHERE amount > 48;", "sql": null}, {"role": "user", "content": "Calculate sum of completed_at for each user_id in billing.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(completed_at) AS sum_completed_at FROM healthcare.billing GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE completed_at > '2023-01-01' ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "List attachment_url, rating, thumbnail from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, rating, thumbnail FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, rating, thumbnail FROM healthcare.appointments WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, rating, thumbnail FROM healthcare.appointments WHERE published_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments where categories LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE categories LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE categories LIKE 'A%' ORDER BY thumbnail ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Arrange the results with categories in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY categories ASC;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY categories ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get total, appointment_id, updated_at, tags by joining doctors with appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.updated_at, appointments.tags FROM healthcare.doctors JOIN healthcare.appointments ON doctors.appointment_id = appointments.id;", "sql": null}, {"role": "user", "content": "Show me count of product_id grouped by quantity for doctors.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(product_id) AS count_product_id FROM healthcare.doctors GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "List appointment_id, approval_status, completed_at from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, approval_status, completed_at FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get doctors that match completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, approval_status, completed_at FROM healthcare.doctors WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the sum completed_at for each approval_status in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(completed_at) AS sum_completed_at FROM healthcare.doctors GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by payment_method descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY payment_method DESC;", "sql": null}, {"role": "user", "content": "Show me max of completed_at grouped by card_type for billing.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MAX(completed_at) AS max_completed_at FROM healthcare.billing GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n order_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n amount bigint,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n card_type varchar,\n user_id text NOT NULL,\n payment_method character varying(64) NOT NULL,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at date,\n tags character varying(128) NOT NULL,\n rating text,\n categories char,\n body varchar NOT NULL,\n score char NOT NULL,\n thumbnail varchar NOT NULL,\n attachment_url character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.order_id,\n FOREIGN KEY (billin_id) REFERENCES billing(order_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n total smallint,\n quantity char,\n approval_status character varying(256),\n product_id text -- identifier for product,\n seller_id character varying(64) -- identifier for seller,\n payment_method character varying(256),\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)", "conversations": [{"role": "user", "content": "What are the buyer_id, user_id, amount of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, user_id, amount FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, user_id, amount FROM healthcare.billing ORDER BY buyer_id DESC;", "sql": null}, {"role": "user", "content": "What is the min amount for each card_type in billing?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MIN(amount) AS min_amount FROM healthcare.billing GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n location_lon character varying(128),\n parking_available varchar NOT NULL,\n type character varying(64) NOT NULL,\n name character varying(128),\n state character varying(128) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n delivery_status character varying(128),\n seller_id character varying(64) NOT NULL -- identifier for seller,\n payment_status varchar,\n exchange_rate varchar,\n buyer_id varchar NOT NULL,\n status char,\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address character varying(64) NOT NULL,\n timezone varchar NOT NULL,\n full_name character varying(128),\n last_login timestamp,\n account_status char,\n nationality text NOT NULL,\n department_id text NOT NULL -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)", "conversations": [{"role": "user", "content": "Get state, created_at, type from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT state, created_at, type FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT state, created_at, type FROM education.departments WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT state, created_at, type FROM education.departments WHERE location_lon LIKE 'A%' ORDER BY parking_available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n location_lon character varying(128),\n parking_available varchar NOT NULL,\n type character varying(64) NOT NULL,\n name character varying(128),\n state character varying(128) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n delivery_status character varying(128),\n seller_id character varying(64) NOT NULL -- identifier for seller,\n payment_status varchar,\n exchange_rate varchar,\n buyer_id varchar NOT NULL,\n status char,\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address character varying(64) NOT NULL,\n timezone varchar NOT NULL,\n full_name character varying(128),\n last_login timestamp,\n account_status char,\n nationality text NOT NULL,\n department_id text NOT NULL -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where address LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE address LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by department_id.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, COUNT(*) AS count FROM education.students GROUP BY department_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n location_lon character varying(128),\n parking_available varchar NOT NULL,\n type character varying(64) NOT NULL,\n name character varying(128),\n state character varying(128) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n delivery_status character varying(128),\n seller_id character varying(64) NOT NULL -- identifier for seller,\n payment_status varchar,\n exchange_rate varchar,\n buyer_id varchar NOT NULL,\n status char,\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address character varying(64) NOT NULL,\n timezone varchar NOT NULL,\n full_name character varying(128),\n last_login timestamp,\n account_status char,\n nationality text NOT NULL,\n department_id text NOT NULL -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve student_id, location_lon, type for every department.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, location_lon, type FROM education.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by student_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, location_lon, type FROM education.departments ORDER BY student_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, location_lon, type FROM education.departments ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n location_lon character varying(128),\n parking_available varchar NOT NULL,\n type character varying(64) NOT NULL,\n name character varying(128),\n state character varying(128) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n delivery_status character varying(128),\n seller_id character varying(64) NOT NULL -- identifier for seller,\n payment_status varchar,\n exchange_rate varchar,\n buyer_id varchar NOT NULL,\n status char,\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address character varying(64) NOT NULL,\n timezone varchar NOT NULL,\n full_name character varying(128),\n last_login timestamp,\n account_status char,\n nationality text NOT NULL,\n department_id text NOT NULL -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the state, name, updated_at of each department?", "sql": null}, {"role": "assistant", "content": "SELECT state, name, updated_at FROM education.departments;", "sql": null}, {"role": "user", "content": "Sort the results by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT state, name, updated_at FROM education.departments ORDER BY parking_available ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT state, name, updated_at FROM education.departments ORDER BY parking_available ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "What are the category, exchange_rate, processed_at of each account?", "sql": null}, {"role": "assistant", "content": "SELECT category, exchange_rate, processed_at FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT category, exchange_rate, processed_at FROM banking.accounts WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by notes ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, exchange_rate, processed_at FROM banking.accounts WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY notes ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Show me processed_at, verification_status, exchange_rate for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, verification_status, exchange_rate FROM banking.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have notes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, verification_status, exchange_rate FROM banking.accounts WHERE notes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of user_id for each verification_status in accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, SUM(user_id) AS sum_user_id FROM banking.accounts GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many accounts are there per exchange_rate?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM banking.accounts GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "List user_id, processed_at, exchange_rate from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, processed_at, exchange_rate FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Get all accounts from last week.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, processed_at, exchange_rate FROM banking.accounts WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, processed_at, exchange_rate FROM banking.accounts WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "What are the category, verification_status, exchange_rate of each account?", "sql": null}, {"role": "assistant", "content": "SELECT category, verification_status, exchange_rate FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, verification_status, exchange_rate FROM banking.accounts ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with notes in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, verification_status, exchange_rate FROM banking.accounts ORDER BY notes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, notes, verification_status for every account.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, notes, verification_status FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Get all accounts modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, notes, verification_status FROM banking.accounts WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM banking.accounts GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Show the results sorted by notes descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts ORDER BY notes DESC;", "sql": null}, {"role": "user", "content": "Get min of exchange_rate by processed_at from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MIN(exchange_rate) AS min_exchange_rate FROM banking.accounts GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, category, user_id for every account.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, category, user_id FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, category, user_id FROM banking.accounts WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, category, user_id FROM banking.accounts WHERE processed_at > '2023-01-01' ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Show me notes, processed_at, account_status, phone from accounts and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.account_status, users.phone FROM banking.accounts JOIN banking.users ON accounts.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.account_status, users.phone FROM banking.accounts JOIN banking.users ON accounts.user_id = users.user_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate char NOT NULL,\n category char,\n verification_status character varying(256) NOT NULL,\n notes text NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE banking.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n phone character varying(256),\n email char NOT NULL,\n bio character varying(64),\n is_active boolean,\n last_login timestamp without time zone,\n account_status text\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts;", "sql": null}, {"role": "user", "content": "Find accounts from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with verification_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.accounts WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY verification_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Show me media_url, subcategory, currency for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, subcategory, currency FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, subcategory, currency FROM e-commerce.inventory WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of inventory in each stock_level category.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, COUNT(*) AS count FROM e-commerce.inventory GROUP BY stock_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get all inventory from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "What status, inventor_id, created_at, subcategory do we have for users and their associated inventory?", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.created_at, inventory.subcategory FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.created_at, inventory.subcategory FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "List inventor_id, last_active, address from users.", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, last_active, address FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, last_active, address FROM e-commerce.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, last_active, address FROM e-commerce.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Retrieve email, address, id for every user.", "sql": null}, {"role": "assistant", "content": "SELECT email, address, id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT email, address, id FROM e-commerce.users WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Can you order these by id descending?", "sql": null}, {"role": "assistant", "content": "SELECT email, address, id FROM e-commerce.users WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, address, last_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT status, address, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, address, last_active FROM e-commerce.users ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Group users by address and show the average of email.", "sql": null}, {"role": "assistant", "content": "SELECT address, AVERAGE(email) AS average_email FROM e-commerce.users GROUP BY address;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve subcategory, order_id, created_at, card_type showing the relationship between inventory and orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.created_at, orders.card_type FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.id;", "sql": null}, {"role": "user", "content": "Get max of media_url by subcategory from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, MAX(media_url) AS max_media_url FROM e-commerce.inventory GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Get last_active, id, address from all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, id, address FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve id, last_active, stock_level, order_id showing the relationship between users and inventory.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, id, address, inventory.stock_level, inventory.order_id FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.id;", "sql": null}, {"role": "user", "content": "Group users by id and show the min of inventor_id.", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(inventor_id) AS min_inventor_id FROM e-commerce.users GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get count of created_at by subcategory from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, COUNT(created_at) AS count_created_at FROM e-commerce.inventory GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n thumbnail_url text NOT NULL,\n currency character varying(64),\n stock_level varchar NOT NULL,\n media_url char,\n subcategory character varying(128),\n order_id text -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n fee text NOT NULL,\n card_type text,\n product_id character varying(64) NOT NULL,\n status character varying(128),\n payment_method text\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n visibility character varying(64),\n description text,\n author_id character varying(128) NOT NULL -- identifier for author,\n tags character varying(128) NOT NULL,\n image_url text,\n rating text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n address text,\n email varchar NOT NULL,\n status character varying(256),\n inventor_id text NOT NULL -- reference to inventory.id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE status LIKE 'A%' ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me customer_id, notes, amount for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, notes, amount FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits that have payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, notes, amount FROM finance.audits WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of audits across different invoice_id values.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM finance.audits GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY customer_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me reference_number, payment_date, amount for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, amount FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, amount FROM finance.audits WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with invoice_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, amount FROM finance.audits WHERE payment_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY invoice_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the payment_date, customer_id, invoice_id of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, customer_id, invoice_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, customer_id, invoice_id FROM finance.audits WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by payment_date descending?", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, customer_id, invoice_id FROM finance.audits WHERE payment_date > '2023-01-01' ORDER BY payment_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List profile_picture_url, nationality, joined_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, nationality, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, nationality, joined_at FROM finance.customers WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, nationality, joined_at FROM finance.customers WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match nationality LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE nationality LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of joined_at grouped by nationality for customers.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, SUM(joined_at) AS sum_joined_at FROM finance.customers GROUP BY nationality;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE status LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match reference_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE reference_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with reference_number in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE reference_number LIKE 'A%' ORDER BY reference_number DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY customer_id DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n updated_at timestamp,\n card_type text NOT NULL,\n tax decimal NOT NULL,\n exchange_rate char,\n customer_id character varying(128) -- identifier for customer,\n product_id char NOT NULL\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url char NOT NULL,\n nationality char NOT NULL\n)\n\nCREATE TABLE finance.audits (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n payee_id character varying(128) -- identifier for payee,\n status text NOT NULL,\n reference_number varchar NOT NULL,\n notes character varying(128) NOT NULL,\n amount smallint,\n customer_id character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Can you order these by tax descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY tax DESC;", "sql": null}, {"role": "user", "content": "Calculate average of product_id for each cancelled_at in transactions.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, AVERAGE(product_id) AS average_product_id FROM finance.transactions GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me edited_at, attachment_url, message_id for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, attachment_url, message_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Can you order these by published_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, attachment_url, message_id FROM socialmedia.comments ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Get sum of published_at by body from comments.", "sql": null}, {"role": "assistant", "content": "SELECT body, SUM(published_at) AS sum_published_at FROM socialmedia.comments GROUP BY body;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many comments are there per message_id?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List parent_id, format, author_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, format, author_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by rating ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, format, author_id FROM socialmedia.messages ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Tally up messages by author_id.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me score, rating, edited_at for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, rating, edited_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT score, rating, edited_at FROM socialmedia.messages WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with format in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT score, rating, edited_at FROM socialmedia.messages WHERE rating LIKE 'A%' ORDER BY format DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate min of image_url for each body in comments.", "sql": null}, {"role": "assistant", "content": "SELECT body, MIN(image_url) AS min_image_url FROM socialmedia.comments GROUP BY body;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Order the output by rating ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by format.", "sql": null}, {"role": "assistant", "content": "SELECT format, COUNT(*) AS count FROM socialmedia.messages GROUP BY format ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY message_id ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY message_id ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "What are the format, score, tags of each message?", "sql": null}, {"role": "assistant", "content": "SELECT format, score, tags FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have visibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT format, score, tags FROM socialmedia.messages WHERE visibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by visibility.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, COUNT(*) AS count FROM socialmedia.messages GROUP BY visibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me rating, edited_at, format for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT rating, edited_at, format FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get messages that match tags LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT rating, edited_at, format FROM socialmedia.messages WHERE tags LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group messages by edited_at and show the count of rating.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(rating) AS count_rating FROM socialmedia.messages GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp,\n body text,\n attachment_url varchar NOT NULL,\n image_url character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n tags character varying(64),\n author_id varchar -- identifier for author,\n score char,\n format character varying(64),\n visibility char,\n rating text NOT NULL,\n parent_id text NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "What are the tags, visibility, score of each message?", "sql": null}, {"role": "assistant", "content": "SELECT tags, visibility, score FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT tags, visibility, score FROM socialmedia.messages WHERE edited_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many messages are there per visibility?", "sql": null}, {"role": "assistant", "content": "SELECT visibility, COUNT(*) AS count FROM socialmedia.messages GROUP BY visibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by zip_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY zip_code DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve last_active, nationality, timezone for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, nationality, timezone FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, nationality, timezone FROM healthcare.patients WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, nationality, timezone FROM healthcare.patients WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get text, created_at, updated_at from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT text, created_at, updated_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have text LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT text, created_at, updated_at FROM healthcare.departments WHERE text LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT text, created_at, updated_at FROM healthcare.departments WHERE text LIKE 'A%' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve tags, updated_at, subject for every department.", "sql": null}, {"role": "assistant", "content": "SELECT tags, updated_at, subject FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT tags, updated_at, subject FROM healthcare.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate count of message for each subject in departments.", "sql": null}, {"role": "assistant", "content": "SELECT subject, COUNT(message) AS count_message FROM healthcare.departments GROUP BY subject;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get created_at, location_lon, id from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_lon, id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_lon, id FROM healthcare.billing WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Calculate count of location_lon for each id in billing.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(location_lon) AS count_location_lon FROM healthcare.billing GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve subject, text, updated_at for every department.", "sql": null}, {"role": "assistant", "content": "SELECT subject, text, updated_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Can you order these by image_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT subject, text, updated_at FROM healthcare.departments ORDER BY image_url ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT subject, text, updated_at FROM healthcare.departments ORDER BY image_url ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Calculate count of tags for each image_url in departments.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(tags) AS count_tags FROM healthcare.departments GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get nationality, status, country from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, status, country FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, status, country FROM healthcare.patients WHERE last_active > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, status, country FROM healthcare.patients WHERE last_active > '2023-12-01' ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the first_name, country, account_status of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, country, account_status FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, country, account_status FROM healthcare.patients WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group patients by account_status and show the average of status.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, AVERAGE(status) AS average_status FROM healthcare.patients GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n comment_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n message character varying(128) NOT NULL,\n tags char,\n text character varying(256),\n image_url character varying(64),\n subject char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone varchar,\n status character varying(256),\n account_status character varying(256) NOT NULL,\n nationality character varying(64) NOT NULL,\n first_name varchar,\n country text NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n location_lon char NOT NULL,\n zip_code character varying(256),\n address_line1 varchar,\n operating_hours varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by first_name descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY first_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "List all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Sort the results by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY available DESC;", "sql": null}, {"role": "user", "content": "Show me the count of appointments grouped by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM healthcare.appointments GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of patients across different appointment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, COUNT(*) AS count FROM healthcare.patients GROUP BY appointment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Retrieve brand, manufacturer, patient_id for every appointment.", "sql": null}, {"role": "assistant", "content": "SELECT brand, manufacturer, patient_id FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Arrange the results with brand in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT brand, manufacturer, patient_id FROM healthcare.appointments ORDER BY brand ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT brand, manufacturer, patient_id FROM healthcare.appointments ORDER BY brand ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "List all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different available values.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM healthcare.appointments GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients with bio LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE bio LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE bio LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List status, appointment_id, created_at, reserved for each patient along with their appointment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.created_at, appointments.reserved FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.id;", "sql": null}, {"role": "user", "content": "Get the distribution of patients across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM healthcare.patients GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "What are the brand, patient_id, reserved of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT brand, patient_id, reserved FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments with patient_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT brand, patient_id, reserved FROM healthcare.appointments WHERE patient_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of video_url grouped by video_url for appointments.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, AVERAGE(video_url) AS average_video_url FROM healthcare.appointments GROUP BY video_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "Show me available, patient_id, video_url for all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT available, patient_id, video_url FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List brand, available, is_active, status for each appointment along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT available, patient_id, video_url, patients.is_active, patients.status FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Arrange the results with patient_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT available, patient_id, video_url, patients.is_active, patients.status FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id ORDER BY patient_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n status varchar,\n bio char,\n website varchar,\n is_active boolean -- indicates if active is true,\n appointment_id text -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.appointments (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n available varchar NOT NULL,\n brand text,\n video_url character varying(128) -- identifier for video_url,\n reserved character varying(64) NOT NULL,\n manufacturer character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)", "conversations": [{"role": "user", "content": "What are the is_active, appointment_id, status of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, appointment_id, status FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get all patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, appointment_id, status FROM healthcare.patients WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group patients by bio and show the count of status.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(status) AS count_status FROM healthcare.patients GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of students across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM education.students GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "What are the status, id, password_hash of each student?", "sql": null}, {"role": "assistant", "content": "SELECT status, id, password_hash FROM education.students;", "sql": null}, {"role": "user", "content": "What password_hash, profile_picture_url, city, membership_level do we have for students and their associated grades?", "sql": null}, {"role": "assistant", "content": "SELECT status, id, password_hash, grades.city, grades.membership_level FROM education.students JOIN education.grades ON students.grade_id = grades.employee_id;", "sql": null}, {"role": "user", "content": "How many students are there per grade_id?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.students GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by profile_picture_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY profile_picture_url DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY profile_picture_url DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get average of id by website from students.", "sql": null}, {"role": "assistant", "content": "SELECT website, AVERAGE(id) AS average_id FROM education.students GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by grade_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY grade_id ASC;", "sql": null}, {"role": "user", "content": "Calculate average of country for each website in students.", "sql": null}, {"role": "assistant", "content": "SELECT website, AVERAGE(country) AS average_country FROM education.students GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, country, grade_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, country, grade_id FROM education.students;", "sql": null}, {"role": "user", "content": "Get all students modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, country, grade_id FROM education.students WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the sum website for each password_hash in students?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, SUM(website) AS sum_website FROM education.students GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "List profile_picture_url, status, password_hash from students.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, status, password_hash FROM education.students;", "sql": null}, {"role": "user", "content": "List students that have password_hash LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, status, password_hash FROM education.students WHERE password_hash LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many students are there per id?", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM education.students GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Show me created_at, status, country for all students.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, country FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve id, grade_id, last_active, membership_level showing the relationship between students and grades.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, country, grades.last_active, grades.membership_level FROM education.students JOIN education.grades ON students.grade_id = grades.employee_id;", "sql": null}, {"role": "user", "content": "What is the count id for each country in students?", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(id) AS count_id FROM education.students GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of grade_id grouped by id for students.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(grade_id) AS count_grade_id FROM education.students GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n website character varying(64),\n profile_picture_url char,\n status character varying(256),\n country character varying(128),\n password_hash character varying(128),\n grade_id integer NOT NULL -- reference to grades.employee_id,\n FOREIGN KEY (grade_id) REFERENCES grades(employee_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n msrp character varying(64),\n backorder character varying(256),\n manufacturer character varying(256),\n tax_rate character varying(128),\n stock_level character varying(256),\n subcategory char\n)\n\nCREATE TABLE education.grades (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n avatar character varying(256) NOT NULL,\n membership_level character varying(128) NOT NULL,\n status varchar NOT NULL,\n address character varying(128) NOT NULL,\n city char\n)", "conversations": [{"role": "user", "content": "Retrieve country, password_hash, profile_picture_url for every student.", "sql": null}, {"role": "assistant", "content": "SELECT country, password_hash, profile_picture_url FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT country, password_hash, profile_picture_url FROM education.students WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get count of password_hash by status from students.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(password_hash) AS count_password_hash FROM education.students GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get media_url, expires_at, available from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, expires_at, available FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get doctors that match media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, expires_at, available FROM healthcare.doctors WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by brand descending.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, expires_at, available FROM healthcare.doctors WHERE media_url LIKE 'A%' ORDER BY brand DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "List name, available, media_url from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT name, available, media_url FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT name, available, media_url FROM healthcare.doctors WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by brand ascending.", "sql": null}, {"role": "assistant", "content": "SELECT name, available, media_url FROM healthcare.doctors WHERE expires_at > '2023-12-01' ORDER BY brand ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get sku, currency, prescription_id from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT sku, currency, prescription_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with prescription_id > 16.", "sql": null}, {"role": "assistant", "content": "SELECT sku, currency, prescription_id FROM healthcare.doctors WHERE prescription_id > 16;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT sku, currency, prescription_id FROM healthcare.doctors WHERE prescription_id > 16 LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Can you order these by brand ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY brand ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different media_url values.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM healthcare.appointments GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n category char NOT NULL,\n media_url char,\n name character varying(256),\n currency text NOT NULL,\n brand char,\n available character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n cancelled_at timestamp,\n price numeric,\n delivery_status character varying(64) NOT NULL,\n approval_status character varying(256)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n age character varying(256) NOT NULL,\n account_status character varying(64),\n birth_date timestamp NOT NULL,\n zip_code character varying(128),\n api_key character varying(128)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n published_at timestamp without time zone,\n media_url character varying(128),\n subject character varying(128),\n format char,\n rating char,\n body text,\n prescription_id integer -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of post_id for each format in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT format, SUM(post_id) AS sum_post_id FROM healthcare.appointments GROUP BY format;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of created_at grouped by category for branches.", "sql": null}, {"role": "assistant", "content": "SELECT category, AVERAGE(created_at) AS average_created_at FROM humanresources.branches GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the currency, created_at, invoice_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, invoice_id FROM humanresources.orders;", "sql": null}, {"role": "user", "content": "Get orders that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, invoice_id FROM humanresources.orders WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count status for each exchange_rate in orders?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(status) AS count_status FROM humanresources.orders GROUP BY exchange_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the status, exchange_rate, invoice_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT status, exchange_rate, invoice_id FROM humanresources.orders;", "sql": null}, {"role": "user", "content": "Find orders where invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, exchange_rate, invoice_id FROM humanresources.orders WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, exchange_rate, invoice_id FROM humanresources.orders WHERE invoice_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the user_id, content, image_url of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content, image_url FROM humanresources.comments;", "sql": null}, {"role": "user", "content": "Show me comments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content, image_url FROM humanresources.comments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content, image_url FROM humanresources.comments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "List all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches;", "sql": null}, {"role": "user", "content": "List branches with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "List all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches;", "sql": null}, {"role": "user", "content": "Find branches modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.branches WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "List parking_available, capacity, latitude from branches.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, capacity, latitude FROM humanresources.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, capacity, latitude FROM humanresources.branches WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by latitude ascending?", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, capacity, latitude FROM humanresources.branches WHERE created_at > '2023-01-01' ORDER BY latitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.orders WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average status for each invoice_id in orders?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, AVERAGE(status) AS average_status FROM humanresources.orders GROUP BY invoice_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "List exchange_rate, status, invoice_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, invoice_id FROM humanresources.orders;", "sql": null}, {"role": "user", "content": "Get orders that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, invoice_id FROM humanresources.orders WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, invoice_id FROM humanresources.orders WHERE exchange_rate LIKE 'A%' ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.comments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(128),\n image_url character varying(128),\n user_id varchar -- identifier for user,\n reply_to_id text,\n shares text,\n likes character varying(64) NOT NULL,\n content character varying(256) NOT NULL\n)\n\nCREATE TABLE humanresources.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status character varying(128),\n currency char NOT NULL,\n exchange_rate varchar NOT NULL\n)\n\nCREATE TABLE humanresources.branches (\n location_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar,\n capacity char,\n latitude varchar,\n parking_available character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, image_url, updated_at for every comment.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, image_url, updated_at FROM humanresources.comments;", "sql": null}, {"role": "user", "content": "Get comments that match user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, image_url, updated_at FROM humanresources.comments WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of reply_to_id for each description in comments.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(reply_to_id) AS average_reply_to_id FROM humanresources.comments GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n nationality character varying(64) NOT NULL,\n status character varying(128) NOT NULL,\n state character varying(256),\n timezone character varying(64) NOT NULL,\n api_key varchar NOT NULL,\n first_name character varying(128),\n inventor_id text NOT NULL -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.categories (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n price numeric,\n amount integer\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n user_id varchar NOT NULL,\n exchange_rate varchar,\n payment_method character varying(128),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at date,\n price decimal,\n backorder char,\n currency character varying(64) NOT NULL,\n name varchar,\n image_url character varying(128),\n discount numeric(38,14),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Order the output by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Show me average of nationality grouped by person_id for users.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, AVERAGE(nationality) AS average_nationality FROM e-commerce.users GROUP BY person_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n nationality character varying(64) NOT NULL,\n status character varying(128) NOT NULL,\n state character varying(256),\n timezone character varying(64) NOT NULL,\n api_key varchar NOT NULL,\n first_name character varying(128),\n inventor_id text NOT NULL -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.categories (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n price numeric,\n amount integer\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n user_id varchar NOT NULL,\n exchange_rate varchar,\n payment_method character varying(128),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at date,\n price decimal,\n backorder char,\n currency character varying(64) NOT NULL,\n name varchar,\n image_url character varying(128),\n discount numeric(38,14),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY payment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n nationality character varying(64) NOT NULL,\n status character varying(128) NOT NULL,\n state character varying(256),\n timezone character varying(64) NOT NULL,\n api_key varchar NOT NULL,\n first_name character varying(128),\n inventor_id text NOT NULL -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.categories (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n price numeric,\n amount integer\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n user_id varchar NOT NULL,\n exchange_rate varchar,\n payment_method character varying(128),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at date,\n price decimal,\n backorder char,\n currency character varying(64) NOT NULL,\n name varchar,\n image_url character varying(128),\n discount numeric(38,14),\n categorie_id integer NOT NULL -- reference to categories.order_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(order_id)\n)", "conversations": [{"role": "user", "content": "What are the currency, expires_at, name of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT currency, expires_at, name FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with image_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, expires_at, name FROM e-commerce.inventory ORDER BY image_url ASC;", "sql": null}, {"role": "user", "content": "Tally up inventory by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM e-commerce.inventory GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "Get created_at, debit, verification_status from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, debit, verification_status FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, debit, verification_status FROM education.teachers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, debit, verification_status FROM education.teachers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show the results sorted by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by grade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY grade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get grade_id, debit, name, operating_hours by joining teachers with grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.name, grades.operating_hours FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.name, grades.operating_hours FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id ORDER BY customer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me grade_id, amount, customer_id for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, amount, customer_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by payer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, amount, customer_id FROM education.teachers ORDER BY payer_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with grade_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, amount, customer_id FROM education.teachers ORDER BY grade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the grade_id, currency, verification_status of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, currency, verification_status FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get amount, updated_at, name, last_inspected by joining teachers with grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, currency, verification_status, grades.name, grades.last_inspected FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id;", "sql": null}, {"role": "user", "content": "Group teachers by payer_id and show the sum of currency.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, SUM(currency) AS sum_currency FROM education.teachers GROUP BY payer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the amount, debit, created_at of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT amount, debit, created_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "What verification_status, payer_id, name, address_line1 do we have for teachers and their associated grades?", "sql": null}, {"role": "assistant", "content": "SELECT amount, debit, created_at, grades.name, grades.address_line1 FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT amount, debit, created_at, grades.name, grades.address_line1 FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve debit, currency, grade_id for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT debit, currency, grade_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by verification_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT debit, currency, grade_id FROM education.teachers ORDER BY verification_status ASC;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT debit, currency, grade_id FROM education.teachers ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve verification_status, payer_id, operating_hours, latitude showing the relationship between teachers and grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.operating_hours, grades.latitude FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.operating_hours, grades.latitude FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.venue_id ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the verification_status, updated_at, customer_id of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, updated_at, customer_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get teachers that match amount > 4.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, updated_at, customer_id FROM education.teachers WHERE amount > 4;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, updated_at, customer_id FROM education.teachers WHERE amount > 4 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n customer_id character varying(64) NOT NULL,\n payer_id char,\n currency char,\n debit varchar,\n amount numeric(38,14),\n verification_status character varying(64),\n grade_id integer NOT NULL -- reference to grades.venue_id,\n FOREIGN KEY (grade_id) REFERENCES grades(venue_id)\n)\n\nCREATE TABLE education.courses (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_login date,\n bio text,\n membership_level character varying(64) NOT NULL,\n salt character varying(256)\n)\n\nCREATE TABLE education.grades (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours char,\n latitude varchar,\n accessibility char,\n address_line1 character varying(64),\n name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me verification_status, created_at, updated_at for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, created_at, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, created_at, updated_at FROM education.teachers WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by grade_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, created_at, updated_at FROM education.teachers WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY grade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me card_type, wallet_id, amount for all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, wallet_id, amount FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by card_type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, wallet_id, amount FROM tradingplatform.metadata ORDER BY card_type ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, wallet_id, amount FROM tradingplatform.metadata ORDER BY card_type ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of status for each created_at in wallets.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(status) AS sum_status FROM tradingplatform.wallets GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many metadata are there per amount?", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Can you order these by status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by wallet_id.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY wallet_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me wallets that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by amount ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me wallets that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the max currency for each status in wallets?", "sql": null}, {"role": "assistant", "content": "SELECT status, MAX(currency) AS max_currency FROM tradingplatform.wallets GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List seller_id, created_at, currency, status for each metadata along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.currency, wallets.status FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Calculate count of wallet_id for each wallet_id in metadata.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(wallet_id) AS count_wallet_id FROM tradingplatform.metadata GROUP BY wallet_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me payment_status, card_type, created_at for all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, card_type, created_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "What amount, payment_status, processed_at, created_at do we have for metadata and their associated wallets?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, card_type, created_at, wallets.processed_at, wallets.created_at FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Order the output by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, card_type, created_at, wallets.processed_at, wallets.created_at FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.payment_id ORDER BY wallet_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n status text,\n payment_status char NOT NULL,\n amount numeric,\n seller_id text NOT NULL -- identifier for seller,\n subtotal numeric(38,14),\n card_type character varying(256),\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at timestamp,\n currency character varying(64) NOT NULL,\n status character varying(128),\n metadat_id integer -- reference to metadata.payment_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the processed_at, status, currency of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, currency FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve metadat_id, status, payment_status, card_type showing the relationship between wallets and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, currency, metadata.payment_status, metadata.card_type FROM tradingplatform.wallets JOIN tradingplatform.metadata ON wallets.metadat_id = metadata.payment_id;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, currency, metadata.payment_status, metadata.card_type FROM tradingplatform.wallets JOIN tradingplatform.metadata ON wallets.metadat_id = metadata.payment_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me traded_at, delivery_status, currency for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, delivery_status, currency FROM travel.transactions;", "sql": null}, {"role": "user", "content": "Can you order these by payment_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, delivery_status, currency FROM travel.transactions ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of transactions in each amount category.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM travel.transactions GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Get is_active, created_at, accessibility, street by joining students with venues.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.accessibility, venues.street FROM travel.students JOIN travel.venues ON students.venue_id = venues.location_id;", "sql": null}, {"role": "user", "content": "How many students are there per nationality?", "sql": null}, {"role": "assistant", "content": "SELECT nationality, COUNT(*) AS count FROM travel.students GROUP BY nationality ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me first_name, is_verified, created_at for all students.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, is_verified, created_at FROM travel.students;", "sql": null}, {"role": "user", "content": "Retrieve full_name, first_name, street, parking_available showing the relationship between students and venues.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, is_verified, created_at, venues.street, venues.parking_available FROM travel.students JOIN travel.venues ON students.venue_id = venues.location_id;", "sql": null}, {"role": "user", "content": "Show me max of last_active grouped by venue_id for students.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, MAX(last_active) AS max_last_active FROM travel.students GROUP BY venue_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "List venue_id, is_verified, password_hash from students.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, is_verified, password_hash FROM travel.students;", "sql": null}, {"role": "user", "content": "Show me students that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, is_verified, password_hash FROM travel.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, is_verified, password_hash FROM travel.students WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Retrieve status, product_id, currency for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT status, product_id, currency FROM travel.transactions;", "sql": null}, {"role": "user", "content": "Find transactions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT status, product_id, currency FROM travel.transactions WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group transactions by delivery_status and show the min of traded_at.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, MIN(traded_at) AS min_traded_at FROM travel.transactions GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.transactions;", "sql": null}, {"role": "user", "content": "Find transactions from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.transactions WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of transactions grouped by delivery_status.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM travel.transactions GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "What are the is_active, full_name, created_at of each student?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, full_name, created_at FROM travel.students;", "sql": null}, {"role": "user", "content": "List students with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, full_name, created_at FROM travel.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, full_name, created_at FROM travel.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Retrieve is_active, first_name, last_inspected, accessibility showing the relationship between students and venues.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.last_inspected, venues.accessibility FROM travel.students JOIN travel.venues ON students.venue_id = venues.location_id;", "sql": null}, {"role": "user", "content": "Show me count of full_name grouped by is_active for students.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(full_name) AS count_full_name FROM travel.students GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Get student_id, delivery_status, currency from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, delivery_status, currency FROM travel.transactions;", "sql": null}, {"role": "user", "content": "Order the output by student_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, delivery_status, currency FROM travel.transactions ORDER BY student_id ASC;", "sql": null}, {"role": "user", "content": "What is the average delivery_status for each delivery_status in transactions?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, AVERAGE(delivery_status) AS average_delivery_status FROM travel.transactions GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp,\n created_at date,\n delivery_status character varying(64),\n status character varying(64),\n product_id character varying(64) -- identifier for product,\n amount smallint,\n currency character varying(256) NOT NULL,\n student_id text -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE travel.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp,\n language text,\n first_name character varying(256),\n nationality character varying(64) NOT NULL,\n password_hash text,\n is_verified boolean,\n full_name text,\n is_active bit,\n venue_id text -- reference to venues.location_id,\n FOREIGN KEY (venue_id) REFERENCES venues(location_id)\n)\n\nCREATE TABLE travel.venues (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp,\n street char,\n address_line2 character varying(128),\n name character varying(128),\n parking_available character varying(256) NOT NULL,\n accessibility text\n)", "conversations": [{"role": "user", "content": "Retrieve payment_id, traded_at, amount for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, traded_at, amount FROM travel.transactions;", "sql": null}, {"role": "user", "content": "Get transactions that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, traded_at, amount FROM travel.transactions WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of student_id for each payment_id in transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(student_id) AS count_student_id FROM travel.transactions GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "List thumbnail_url, category, popularity_score from assets.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, category, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets with thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, category, popularity_score FROM tradingplatform.assets WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of thumbnail_url by popularity_score from assets.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, SUM(thumbnail_url) AS sum_thumbnail_url FROM tradingplatform.assets GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "What are the published_at, thumbnail_url, popularity_score of each asset?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail_url, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List published_at, description, payer_id, currency for each asset along with their metadata information.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail_url, popularity_score, metadata.payer_id, metadata.currency FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id;", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different item_id values.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY item_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Can you order these by description ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Group assets by popularity_score and show the max of item_id.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, MAX(item_id) AS max_item_id FROM tradingplatform.assets GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve metadat_id, thumbnail_url, updated_at, payee_id showing the relationship between assets and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.updated_at, metadata.payee_id FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id;", "sql": null}, {"role": "user", "content": "Order the output by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.updated_at, metadata.payee_id FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id ORDER BY category DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE published_at > '2023-12-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get all assets between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me average of metadat_id grouped by description for assets.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(metadat_id) AS average_metadat_id FROM tradingplatform.assets GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Display all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Arrange the results with description in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "How many assets are there per metadat_id?", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY metadat_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What popularity_score, published_at, currency, payee_id do we have for assets and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.currency, metadata.payee_id FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.currency, metadata.payee_id FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id ORDER BY discount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What description, category, currency, notes do we have for assets and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.currency, metadata.notes FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.invoice_id;", "sql": null}, {"role": "user", "content": "Show me the count of assets grouped by discount.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM tradingplatform.assets GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n discount numeric NOT NULL,\n thumbnail_url character varying(128),\n description character varying(64) NOT NULL,\n popularity_score character varying(128),\n category text,\n metadat_id text NOT NULL -- reference to metadata.invoice_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n currency character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n payer_id character varying(64),\n category character varying(64) NOT NULL,\n notes varchar\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show the results sorted by thumbnail_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY thumbnail_url ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of metadat_id for each item_id in assets.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, SUM(metadat_id) AS sum_metadat_id FROM tradingplatform.assets GROUP BY item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Retrieve id, user_id, name for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT id, user_id, name FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by backorder descending.", "sql": null}, {"role": "assistant", "content": "SELECT id, user_id, name FROM socialmedia.followers ORDER BY backorder DESC;", "sql": null}, {"role": "user", "content": "Get sum of backorder by name from followers.", "sql": null}, {"role": "assistant", "content": "SELECT name, SUM(backorder) AS sum_backorder FROM socialmedia.followers GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me backorder, published_at, created_at, website from followers and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.created_at, users.website FROM socialmedia.followers JOIN socialmedia.users ON followers.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "How many followers are there per backorder?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM socialmedia.followers GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Get id, subcategory, backorder from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT id, subcategory, backorder FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT id, subcategory, backorder FROM socialmedia.followers WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT id, subcategory, backorder FROM socialmedia.followers WHERE expires_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List name, backorder, created_at, website for each follower along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.created_at, users.website FROM socialmedia.followers JOIN socialmedia.users ON followers.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by price ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.created_at, users.website FROM socialmedia.followers JOIN socialmedia.users ON followers.user_id = users.user_id ORDER BY price ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "What are the user_id, subcategory, price of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, subcategory, price FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, subcategory, price FROM socialmedia.followers ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, subcategory, price FROM socialmedia.followers ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE backorder LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What id, backorder, last_active, salt do we have for followers and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT *, users.last_active, users.salt FROM socialmedia.followers JOIN socialmedia.users ON followers.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Get max of published_at by price from followers.", "sql": null}, {"role": "assistant", "content": "SELECT price, MAX(published_at) AS max_published_at FROM socialmedia.followers GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "List subcategory, user_id, price from followers.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, user_id, price FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, user_id, price FROM socialmedia.followers WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with expires_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, user_id, price FROM socialmedia.followers WHERE user_id LIKE 'A%' ORDER BY expires_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "Get price, expires_at, published_at from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT price, expires_at, published_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get all followers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT price, expires_at, published_at FROM socialmedia.followers WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group followers by expires_at and show the sum of id.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, SUM(id) AS sum_id FROM socialmedia.followers GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active timestamp,\n country character varying(256) NOT NULL,\n salt text NOT NULL,\n website text NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n price smallint,\n name text NOT NULL,\n subcategory character varying(64),\n backorder varchar NOT NULL,\n thumbnail_url character varying(128),\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n last_name text,\n phone character varying(128),\n state varchar\n)", "conversations": [{"role": "user", "content": "List expires_at, price, subcategory from followers.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, subcategory FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, subcategory FROM socialmedia.followers WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different id values.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM socialmedia.followers GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations;", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations ORDER BY category ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Get address_line2, purchase_id, address_id from all locations.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, purchase_id, address_id FROM travel.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, purchase_id, address_id FROM travel.locations WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me min of last_inspected grouped by state for locations.", "sql": null}, {"role": "assistant", "content": "SELECT state, MIN(last_inspected) AS min_last_inspected FROM travel.locations GROUP BY state;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "List updated_at, purchase_id, fee, cancelled_at for each student along with their purchase information.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.fee, purchases.cancelled_at FROM travel.students JOIN travel.purchases ON students.purchase_id = purchases.id;", "sql": null}, {"role": "user", "content": "Order the output by is_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.fee, purchases.cancelled_at FROM travel.students JOIN travel.purchases ON students.purchase_id = purchases.id ORDER BY is_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations;", "sql": null}, {"role": "user", "content": "Order the output by student_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations ORDER BY student_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of locations in each state category.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM travel.locations GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the purchase_id, state, address_id of each location?", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, state, address_id FROM travel.locations;", "sql": null}, {"role": "user", "content": "Sort the results by accessibility descending.", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, state, address_id FROM travel.locations ORDER BY accessibility DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, state, address_id FROM travel.locations ORDER BY accessibility DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "List students that have birth_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE birth_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE birth_date > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by bio descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students ORDER BY bio DESC;", "sql": null}, {"role": "user", "content": "Sort the results by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, student_id, state for every location.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, student_id, state FROM travel.locations;", "sql": null}, {"role": "user", "content": "Find locations where address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, student_id, state FROM travel.locations WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, student_id, state FROM travel.locations WHERE address_line2 LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations;", "sql": null}, {"role": "user", "content": "Sort the results by student_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations ORDER BY student_id DESC;", "sql": null}, {"role": "user", "content": "How many locations are there per category?", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM travel.locations GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n website char,\n birth_date timestamp NOT NULL,\n is_active boolean,\n bio text,\n last_login timestamp without time zone,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.locations (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n operating_hours character varying(64),\n address_line2 character varying(256),\n state text NOT NULL,\n capacity char,\n category text,\n accessibility varchar NOT NULL,\n student_id text -- reference to students.id,\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (student_id) REFERENCES students(id),\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE travel.purchases (\n id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status varchar,\n quantity character varying(64),\n user_id char -- identifier for user,\n fee character varying(128),\n currency character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations;", "sql": null}, {"role": "user", "content": "Order the output by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.locations ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different operating_hours values.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM travel.locations GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with barcode in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY barcode DESC;", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM healthcare.departments GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY featured_rank DESC;", "sql": null}, {"role": "user", "content": "Order the output by patient_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY patient_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by msrp ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY msrp ASC;", "sql": null}, {"role": "user", "content": "Order the output by featured_rank ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY featured_rank ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "List description, subcategory, barcode from departments.", "sql": null}, {"role": "assistant", "content": "SELECT description, subcategory, barcode FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve created_at, msrp, joined_at, membership_level showing the relationship between departments and patients.", "sql": null}, {"role": "assistant", "content": "SELECT description, subcategory, barcode, patients.joined_at, patients.membership_level FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Get count of created_at by subcategory from departments.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, COUNT(created_at) AS count_created_at FROM healthcare.departments GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the subcategory, patient_id, created_at of each department?", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, patient_id, created_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where patient_id > 82.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, patient_id, created_at FROM healthcare.departments WHERE patient_id > 82;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different barcode values.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, COUNT(*) AS count FROM healthcare.departments GROUP BY barcode ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve description, barcode, age, first_name showing the relationship between departments and patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.age, patients.first_name FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Group departments by msrp and show the sum of msrp.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, SUM(msrp) AS sum_msrp FROM healthcare.departments GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get subcategory, patient_id, avatar, joined_at by joining departments with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.avatar, patients.joined_at FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Tally up departments by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM healthcare.departments GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "List msrp, barcode, featured_rank from departments.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, barcode, featured_rank FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, barcode, featured_rank FROM healthcare.departments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the average description for each created_at in departments?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, AVERAGE(description) AS average_description FROM healthcare.departments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n subcategory character varying(128) NOT NULL,\n featured_rank char NOT NULL,\n description character varying(128),\n msrp varchar NOT NULL,\n patient_id integer NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n age character varying(64),\n timezone character varying(128) NOT NULL,\n membership_level char,\n avatar character varying(128) NOT NULL,\n first_name character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve patient_id, description, msrp for every department.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, description, msrp FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Sort the results by barcode descending.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, description, msrp FROM healthcare.departments ORDER BY barcode DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with description in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, description, msrp FROM healthcare.departments ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point character varying(128),\n country character varying(128) NOT NULL,\n type character varying(128),\n operating_hours character varying(256),\n zip_code char,\n parking_available character varying(64),\n name varchar NOT NULL,\n grade_id integer -- reference to grades.content_id,\n teacher_id text -- reference to teachers.id,\n FOREIGN KEY (grade_id) REFERENCES grades(content_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n language varchar NOT NULL,\n last_login timestamp,\n display_name varchar NOT NULL,\n profile_picture_url varchar\n)\n\nCREATE TABLE education.grades (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n author_id text,\n attachment_url character varying(64),\n likes character varying(64)\n)\n\nCREATE TABLE education.teachers (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n processed_at date,\n approval_status character varying(256) NOT NULL,\n exchange_rate char,\n student_id integer NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where grade_id > 8.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE grade_id > 8;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE grade_id > 8 LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point character varying(128),\n country character varying(128) NOT NULL,\n type character varying(128),\n operating_hours character varying(256),\n zip_code char,\n parking_available character varying(64),\n name varchar NOT NULL,\n grade_id integer -- reference to grades.content_id,\n teacher_id text -- reference to teachers.id,\n FOREIGN KEY (grade_id) REFERENCES grades(content_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n language varchar NOT NULL,\n last_login timestamp,\n display_name varchar NOT NULL,\n profile_picture_url varchar\n)\n\nCREATE TABLE education.grades (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n author_id text,\n attachment_url character varying(64),\n likes character varying(64)\n)\n\nCREATE TABLE education.teachers (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n processed_at date,\n approval_status character varying(256) NOT NULL,\n exchange_rate char,\n student_id integer NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get all teachers from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE payment_date >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE payment_date >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point character varying(128),\n country character varying(128) NOT NULL,\n type character varying(128),\n operating_hours character varying(256),\n zip_code char,\n parking_available character varying(64),\n name varchar NOT NULL,\n grade_id integer -- reference to grades.content_id,\n teacher_id text -- reference to teachers.id,\n FOREIGN KEY (grade_id) REFERENCES grades(content_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n language varchar NOT NULL,\n last_login timestamp,\n display_name varchar NOT NULL,\n profile_picture_url varchar\n)\n\nCREATE TABLE education.grades (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n author_id text,\n attachment_url character varying(64),\n likes character varying(64)\n)\n\nCREATE TABLE education.teachers (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n processed_at date,\n approval_status character varying(256) NOT NULL,\n exchange_rate char,\n student_id integer NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by payment_date descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE processed_at > '2023-12-01' ORDER BY payment_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point character varying(128),\n country character varying(128) NOT NULL,\n type character varying(128),\n operating_hours character varying(256),\n zip_code char,\n parking_available character varying(64),\n name varchar NOT NULL,\n grade_id integer -- reference to grades.content_id,\n teacher_id text -- reference to teachers.id,\n FOREIGN KEY (grade_id) REFERENCES grades(content_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n language varchar NOT NULL,\n last_login timestamp,\n display_name varchar NOT NULL,\n profile_picture_url varchar\n)\n\nCREATE TABLE education.grades (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n author_id text,\n attachment_url character varying(64),\n likes character varying(64)\n)\n\nCREATE TABLE education.teachers (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n processed_at date,\n approval_status character varying(256) NOT NULL,\n exchange_rate char,\n student_id integer NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Order the output by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY payment_date DESC;", "sql": null}, {"role": "user", "content": "Count the number of teachers in each payment_date category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, COUNT(*) AS count FROM education.teachers GROUP BY payment_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n address_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point character varying(128),\n country character varying(128) NOT NULL,\n type character varying(128),\n operating_hours character varying(256),\n zip_code char,\n parking_available character varying(64),\n name varchar NOT NULL,\n grade_id integer -- reference to grades.content_id,\n teacher_id text -- reference to teachers.id,\n FOREIGN KEY (grade_id) REFERENCES grades(content_id),\n FOREIGN KEY (teacher_id) REFERENCES teachers(id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(64),\n language varchar NOT NULL,\n last_login timestamp,\n display_name varchar NOT NULL,\n profile_picture_url varchar\n)\n\nCREATE TABLE education.grades (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n author_id text,\n attachment_url character varying(64),\n likes character varying(64)\n)\n\nCREATE TABLE education.teachers (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n processed_at date,\n approval_status character varying(256) NOT NULL,\n exchange_rate char,\n student_id integer NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by payment_date ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE exchange_rate LIKE 'A%' ORDER BY payment_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "List order_id, approval_status, currency from categories.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, currency FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories with approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, currency FROM e-commerce.categories WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, currency FROM e-commerce.categories WHERE approval_status LIKE 'A%' ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me gender, full_name, updated_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT gender, full_name, updated_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping from last week.", "sql": null}, {"role": "assistant", "content": "SELECT gender, full_name, updated_at FROM e-commerce.shipping WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of shipping grouped by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM e-commerce.shipping GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me cost, published_at, name for all products.", "sql": null}, {"role": "assistant", "content": "SELECT cost, published_at, name FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT cost, published_at, name FROM e-commerce.products WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group products by views and show the count of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(published_at) AS count_published_at FROM e-commerce.products GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate average of rating for each updated_at in products.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(rating) AS average_rating FROM e-commerce.products GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories with approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of categories across different order_id values.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(*) AS count FROM e-commerce.categories GROUP BY order_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get currency, payment_status, delivery_status from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT currency, payment_status, delivery_status FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories that have payment_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, payment_status, delivery_status FROM e-commerce.categories WHERE payment_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of categories in each payment_status category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM e-commerce.categories GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Arrange the results with language in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY language DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Arrange the results with language in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY language DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve payment_status, exchange_rate, delivery_status for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, exchange_rate, delivery_status FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, exchange_rate, delivery_status FROM e-commerce.categories WHERE completed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, exchange_rate, delivery_status FROM e-commerce.categories WHERE completed_at > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp,\n views varchar,\n rating char,\n cost decimal,\n name char\n)\n\nCREATE TABLE e-commerce.shipping (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256),\n full_name character varying(64) NOT NULL,\n username character varying(64),\n language varchar NOT NULL\n)\n\nCREATE TABLE e-commerce.categories (\n order_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n buyer_id character varying(64) -- identifier for buyer,\n delivery_status char,\n approval_status character varying(128),\n currency char,\n exchange_rate character varying(128) NOT NULL,\n payment_status char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY name ASC;", "sql": null}, {"role": "user", "content": "How many products are there per cost?", "sql": null}, {"role": "assistant", "content": "SELECT cost, COUNT(*) AS count FROM e-commerce.products GROUP BY cost ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get updated_at, seller_id, currency from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, currency FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, seller_id, currency FROM healthcare.billing WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many billing are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM healthcare.billing GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get payment_method, currency, total from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, total FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, total FROM healthcare.billing WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, currency, total FROM healthcare.billing WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by address_line1 ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY address_line1 ASC;", "sql": null}, {"role": "user", "content": "Group prescriptions by accessibility and show the count of accessibility.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(accessibility) AS count_accessibility FROM healthcare.prescriptions GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by address_line1 ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY address_line1 ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY address_line1 ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of billing in each buyer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(*) AS count FROM healthcare.billing GROUP BY buyer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with seller_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY seller_id ASC;", "sql": null}, {"role": "user", "content": "How many billing are there per buyer_id?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(*) AS count FROM healthcare.billing GROUP BY buyer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by last_inspected descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_inspected DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_method in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY payment_method DESC;", "sql": null}, {"role": "user", "content": "Show me min of payment_method grouped by payment_method for billing.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, MIN(payment_method) AS min_payment_method FROM healthcare.billing GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of appointments grouped by cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM healthcare.appointments GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at timestamp without time zone,\n buyer_id varchar -- identifier for buyer,\n card_type character varying(64) NOT NULL,\n user_id character varying(64) -- identifier for user,\n subtotal decimal NOT NULL,\n price smallint,\n payment_status char NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n accessibility character varying(64),\n operating_hours character varying(256),\n address_line1 text\n)\n\nCREATE TABLE healthcare.billing (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n payment_method character varying(128) NOT NULL,\n total bigint NOT NULL,\n currency text,\n seller_id varchar NOT NULL -- identifier for seller,\n buyer_id char -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "What are the payment_method, updated_at, seller_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, updated_at, seller_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, updated_at, seller_id FROM healthcare.billing WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the count updated_at for each updated_at in billing?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(updated_at) AS count_updated_at FROM healthcare.billing GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "Get due_date, payer_id, invoice_number from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payer_id, invoice_number FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by payee_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payer_id, invoice_number FROM finance.accounts ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM finance.accounts GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by address_line2 descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY address_line2 DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_status DESC;", "sql": null}, {"role": "user", "content": "Count the number of transactions in each customer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.transactions GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me customer_id, updated_at, latitude, zip_code from transactions and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.latitude, loans.zip_code FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.id;", "sql": null}, {"role": "user", "content": "Tally up transactions by loan_id.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, COUNT(*) AS count FROM finance.transactions GROUP BY loan_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "Retrieve payee_id, loan_id, invoice_number for every account.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, loan_id, invoice_number FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with due_date in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, loan_id, invoice_number FROM finance.accounts ORDER BY due_date DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, loan_id, invoice_number FROM finance.accounts ORDER BY due_date DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n currency text NOT NULL,\n product_id character varying(128) NOT NULL,\n seller_id character varying(128) NOT NULL,\n customer_id character varying(256) NOT NULL,\n subtotal bigint NOT NULL,\n payment_status character varying(256),\n loan_id text NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payee_id character varying(64),\n invoice_number varchar,\n payer_id character varying(256),\n loan_id text -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.loans (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n operating_hours text,\n description varchar NOT NULL,\n zip_code character varying(256),\n timezone char,\n latitude varchar,\n accessibility varchar,\n address_line2 character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n geo_point text NOT NULL,\n capacity varchar,\n operating_hours char,\n type character varying(256),\n address_line1 char\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE account_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, status, trade_id of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Retrieve last_login, trade_id, user_id, processed_at showing the relationship between metadata and trades.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id, trades.user_id, trades.processed_at FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Arrange the results with last_login in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id, trades.user_id, trades.processed_at FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.invoice_id ORDER BY last_login DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, user_id, total for all trades.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, total FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get trades that match processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, total FROM tradingplatform.trades WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by total descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, user_id, total FROM tradingplatform.trades WHERE processed_at > '2023-01-01' ORDER BY total DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List avatar, display_name, phone from users.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, phone FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me trade_id, language, user_id, currency from users and their related trades.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, phone, trades.user_id, trades.currency FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by trade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, phone, trades.user_id, trades.currency FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.invoice_id ORDER BY trade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get trades that match user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many trades are there per processed_at?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM tradingplatform.trades GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get phone, updated_at, trade_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT phone, updated_at, trade_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "What avatar, trade_id, created_at, currency do we have for users and their associated trades?", "sql": null}, {"role": "assistant", "content": "SELECT phone, updated_at, trade_id, trades.created_at, trades.currency FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Group users by updated_at and show the average of joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(joined_at) AS average_joined_at FROM tradingplatform.users GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group trades by currency and show the max of payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT currency, MAX(payment_status) AS max_payment_status FROM tradingplatform.trades GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, status, trade_id for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Retrieve last_login, joined_at, processed_at, total showing the relationship between metadata and trades.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id, trades.processed_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, status, trade_id, trades.processed_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.invoice_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by last_login descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY last_login DESC;", "sql": null}, {"role": "user", "content": "What is the count created_at for each trade_id in metadata?", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, COUNT(created_at) AS count_created_at FROM tradingplatform.metadata GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n language char,\n avatar char,\n display_name character varying(128),\n phone character varying(64),\n is_active bit,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp,\n last_login timestamp without time zone,\n status character varying(64),\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at timestamp,\n payment_status character varying(256),\n total bigint,\n currency varchar,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have avatar LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE avatar LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of updated_at by trade_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, MAX(updated_at) AS max_updated_at FROM tradingplatform.users GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve wallet_id, customer_id, exchange_rate for every trade.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, customer_id, exchange_rate FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, customer_id, exchange_rate FROM tradingplatform.trades WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with processed_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, customer_id, exchange_rate FROM tradingplatform.trades WHERE processed_at > '2023-01-01' ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me card_type, created_at, wallet_id for all trades.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, wallet_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Sort the results by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, wallet_id FROM tradingplatform.trades ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, wallet_id FROM tradingplatform.trades ORDER BY wallet_id DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve processed_at, invoice_id, updated_at, customer_id showing the relationship between trades and wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.updated_at, wallets.customer_id FROM tradingplatform.trades JOIN tradingplatform.wallets ON trades.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Order the output by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.updated_at, wallets.customer_id FROM tradingplatform.trades JOIN tradingplatform.wallets ON trades.wallet_id = wallets.account_id ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me manufacturer, expires_at, reconciliation_status, customer_id from metadata and their related wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.reconciliation_status, wallets.customer_id FROM tradingplatform.metadata JOIN tradingplatform.wallets ON metadata.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Show me count of wallet_id grouped by thumbnail_url for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(wallet_id) AS count_wallet_id FROM tradingplatform.metadata GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve expires_at, brand, available for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, brand, available FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, brand, available FROM tradingplatform.metadata WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, brand, available FROM tradingplatform.metadata WHERE available LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get all trades modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of trades grouped by invoice_id.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM tradingplatform.trades GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get all metadata created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE expires_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Retrieve metadata where wallet_id > 80.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE wallet_id > 80;", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by manufacturer.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY manufacturer ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n card_type character varying(256),\n product_id character varying(256) -- identifier for product,\n exchange_rate char,\n customer_id text NOT NULL -- identifier for customer,\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n balance numeric(38,14) NOT NULL,\n reconciliation_status character varying(128),\n customer_id character varying(128),\n payee_id character varying(128) NOT NULL,\n vendor_id varchar -- identifier for vendor,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at date,\n brand character varying(128),\n available character varying(256) NOT NULL,\n manufacturer text,\n thumbnail_url character varying(128),\n popularity_score character varying(64),\n wallet_id integer NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Group trades by wallet_id and show the count of invoice_id.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(invoice_id) AS count_invoice_id FROM tradingplatform.trades GROUP BY wallet_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me good_id, venue_id, postal_code for all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT good_id, venue_id, postal_code FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Arrange the results with venue_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT good_id, venue_id, postal_code FROM inventory.addresses ORDER BY venue_id ASC;", "sql": null}, {"role": "user", "content": "What is the max postal_code for each venue_id in addresses?", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, MAX(postal_code) AS max_postal_code FROM inventory.addresses GROUP BY venue_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Find addresses where location_lat LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE location_lat LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of address_line1 for each created_at in addresses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(address_line1) AS max_address_line1 FROM inventory.addresses GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Order the output by good_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY good_id ASC;", "sql": null}, {"role": "user", "content": "Tally up addresses by venue_id.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, COUNT(*) AS count FROM inventory.addresses GROUP BY venue_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Get good_id, created_at, address_line1 from all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT good_id, created_at, address_line1 FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Get addresses that match good_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT good_id, created_at, address_line1 FROM inventory.addresses WHERE good_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT good_id, created_at, address_line1 FROM inventory.addresses WHERE good_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Retrieve addresses where postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by postal_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE postal_code LIKE 'A%' ORDER BY postal_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me created_at, good_id, address_line1 for all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, good_id, address_line1 FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Find addresses where good_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, good_id, address_line1 FROM inventory.addresses WHERE good_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many addresses are there per location_lat?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM inventory.addresses GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Retrieve location_lat, good_id, cost, subcategory showing the relationship between addresses and goods.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.cost, goods.subcategory FROM inventory.addresses JOIN inventory.goods ON addresses.good_id = goods.product_id;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.cost, goods.subcategory FROM inventory.addresses JOIN inventory.goods ON addresses.good_id = goods.product_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "What address_line1, created_at, created_at, subcategory do we have for addresses and their associated goods?", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.created_at, goods.subcategory FROM inventory.addresses JOIN inventory.goods ON addresses.good_id = goods.product_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.created_at, goods.subcategory FROM inventory.addresses JOIN inventory.goods ON addresses.good_id = goods.product_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses ORDER BY created_at ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n postal_code character varying(128),\n location_lat character varying(64),\n address_line1 character varying(256) NOT NULL,\n good_id text -- reference to goods.product_id,\n FOREIGN KEY (good_id) REFERENCES goods(product_id)\n)\n\nCREATE TABLE inventory.goods (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n created_at date,\n subcategory character varying(128) NOT NULL,\n cost numeric NOT NULL,\n views character varying(128) NOT NULL\n)\n\nCREATE TABLE inventory.reservations (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n traded_at date,\n card_type character varying(256),\n tax decimal,\n approval_status character varying(256),\n payment_method text,\n fee text\n)", "conversations": [{"role": "user", "content": "Get all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by venue_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.addresses WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY venue_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get review_id, expires_at, featured_rank from all items.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, expires_at, featured_rank FROM government.items;", "sql": null}, {"role": "user", "content": "Arrange the results with expires_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, expires_at, featured_rank FROM government.items ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show me count of description grouped by expires_at for items.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(description) AS count_description FROM government.items GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me review_id, featured_rank, description for all items.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, featured_rank, description FROM government.items;", "sql": null}, {"role": "user", "content": "List msrp, subcategory, edited_at, format for each item along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, featured_rank, description, reviews.edited_at, reviews.format FROM government.items JOIN government.reviews ON items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "How many items are there per subcategory?", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, COUNT(*) AS count FROM government.items GROUP BY subcategory ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Can you order these by video_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY video_url ASC;", "sql": null}, {"role": "user", "content": "Calculate average of expires_at for each subcategory in items.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, AVERAGE(expires_at) AS average_expires_at FROM government.items GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Find items where expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Show me items that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group items by featured_rank and show the max of featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, MAX(featured_rank) AS max_featured_rank FROM government.items GROUP BY featured_rank;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve review_id, description, subcategory for every item.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, description, subcategory FROM government.items;", "sql": null}, {"role": "user", "content": "List items that have video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, description, subcategory FROM government.items WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min featured_rank for each msrp in items?", "sql": null}, {"role": "assistant", "content": "SELECT msrp, MIN(featured_rank) AS min_featured_rank FROM government.items GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Retrieve items where msrp LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE msrp LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by video_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE msrp LIKE 'A%' ORDER BY video_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "List subcategory, description, msrp from items.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, description, msrp FROM government.items;", "sql": null}, {"role": "user", "content": "List description, review_id, edited_at, subject for each item along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, description, msrp, reviews.edited_at, reviews.subject FROM government.items JOIN government.reviews ON items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "Show me average of description grouped by review_id for items.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, AVERAGE(description) AS average_description FROM government.items GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Retrieve items where featured_rank LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE featured_rank LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of description for each msrp in items.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, AVERAGE(description) AS average_description FROM government.items GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n featured_rank varchar,\n msrp varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n description char,\n subcategory text,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE government.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n subject character varying(128),\n image_url character varying(256),\n shares char,\n tags varchar NOT NULL,\n format text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Retrieve video_url, expires_at, subject, tags showing the relationship between items and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.subject, reviews.tags FROM government.items JOIN government.reviews ON items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "Get count of review_id by video_url from items.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, COUNT(review_id) AS count_review_id FROM government.items GROUP BY video_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me categorie_id, buyer_id, status for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, buyer_id, status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Order the output by order_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, buyer_id, status FROM e-commerce.shipping ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, buyer_id, status FROM e-commerce.shipping ORDER BY order_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me processed_at, categorie_id, buyer_id, cancelled_at from orders and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.buyer_id, categories.cancelled_at FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "Can you order these by price ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.buyer_id, categories.cancelled_at FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.id ORDER BY price ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get processed_at, payment_status, categorie_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_status, categorie_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get all orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_status, categorie_id FROM e-commerce.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many orders are there per price?", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM e-commerce.orders GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me payment_status, subtotal, categorie_id for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, subtotal, categorie_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where payment_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, subtotal, categorie_id FROM e-commerce.orders WHERE payment_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different payment_status values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM e-commerce.orders GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "List price, categorie_id, currency from orders.", "sql": null}, {"role": "assistant", "content": "SELECT price, categorie_id, currency FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders with subtotal > 39.", "sql": null}, {"role": "assistant", "content": "SELECT price, categorie_id, currency FROM e-commerce.orders WHERE subtotal > 39;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT price, categorie_id, currency FROM e-commerce.orders WHERE subtotal > 39 LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get status, order_id, updated_at from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT status, order_id, updated_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have categorie_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, order_id, updated_at FROM e-commerce.shipping WHERE categorie_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min subtotal for each status in shipping?", "sql": null}, {"role": "assistant", "content": "SELECT status, MIN(subtotal) AS min_subtotal FROM e-commerce.shipping GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "What are the buyer_id, order_id, delivery_status of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, order_id, delivery_status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get all shipping modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, order_id, delivery_status FROM e-commerce.shipping WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, order_id, delivery_status FROM e-commerce.shipping WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get card_type, payment_status, amount, approval_status by joining shipping with categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.amount, categories.approval_status FROM e-commerce.shipping JOIN e-commerce.categories ON shipping.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "Arrange the results with categorie_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.amount, categories.approval_status FROM e-commerce.shipping JOIN e-commerce.categories ON shipping.categorie_id = categories.id ORDER BY categorie_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n completed_at date,\n status char,\n payment_status text NOT NULL,\n buyer_id char,\n subtotal integer,\n amount bigint,\n card_type varchar,\n delivery_status char NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n tax bigint,\n buyer_id character varying(128) NOT NULL,\n amount integer,\n approval_status varchar\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency character varying(64) NOT NULL,\n price integer,\n payment_status character varying(128),\n subtotal integer,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, card_type, delivery_status from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, card_type, delivery_status FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, card_type, delivery_status FROM e-commerce.shipping WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by order_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, card_type, delivery_status FROM e-commerce.shipping WHERE delivery_status LIKE 'A%' ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List total, card_type, updated_at, amount for each transaction along with their account information.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.updated_at, accounts.amount FROM finance.transactions JOIN finance.accounts ON transactions.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Count the number of transactions in each total category.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM finance.transactions GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "What sku, updated_at, category, updated_at do we have for loans and their associated accounts?", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.category, accounts.updated_at FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Show me sum of stock_level grouped by tax_rate for loans.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, SUM(stock_level) AS sum_stock_level FROM finance.loans GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "List buyer_id, payment_id, account_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_id, account_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_id, account_id FROM finance.transactions ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by card_type descending?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_id, account_id FROM finance.transactions ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Get total, updated_at, account_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT total, updated_at, account_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT total, updated_at, account_id FROM finance.transactions ORDER BY buyer_id ASC;", "sql": null}, {"role": "user", "content": "Get max of buyer_id by customer_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(buyer_id) AS max_buyer_id FROM finance.transactions GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get updated_at, tax_rate, invoice_number, category by joining loans with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.invoice_number, accounts.category FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.invoice_number, accounts.category FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.account_id ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by card_type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at > '2023-01-01' ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Get card_type, total, customer_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, total, customer_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, total, customer_id FROM finance.transactions WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, total, customer_id FROM finance.transactions WHERE updated_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n card_type char,\n customer_id varchar,\n total bigint NOT NULL,\n buyer_id text,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n due_date date,\n category varchar,\n invoice_number character varying(128) NOT NULL,\n amount smallint NOT NULL,\n currency character varying(64),\n approval_status character varying(128),\n reconciliation_status character varying(256) NOT NULL,\n balance decimal NOT NULL\n)\n\nCREATE TABLE finance.audits (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n image_url character varying(128),\n parent_id text,\n media_url character varying(256),\n title varchar\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n image_url varchar,\n tax_rate character varying(64),\n stock_level character varying(64) NOT NULL,\n account_id text -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "What are the sku, stock_level, tax_rate of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT sku, stock_level, tax_rate FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT sku, stock_level, tax_rate FROM finance.loans WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with tax_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT sku, stock_level, tax_rate FROM finance.loans WHERE image_url LIKE 'A%' ORDER BY tax_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "What profile_picture_url, last_name, expires_at, popularity_score do we have for customers and their associated goods?", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.expires_at, goods.popularity_score FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id;", "sql": null}, {"role": "user", "content": "Show me sum of state grouped by created_at for customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(state) AS sum_state FROM restaurant.customers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, state, created_at for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, created_at FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, created_at FROM restaurant.customers WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, created_at FROM restaurant.customers WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Get id, profile_picture_url, good_id from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT id, profile_picture_url, good_id FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Get profile_picture_url, good_id, expires_at, media_url by joining customers with goods.", "sql": null}, {"role": "assistant", "content": "SELECT id, profile_picture_url, good_id, goods.expires_at, goods.media_url FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT id, profile_picture_url, good_id, goods.expires_at, goods.media_url FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Find customers where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers WHERE created_at > '2023-01-01' ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Show me profile_picture_url, id, popularity_score, media_url from customers and their related goods.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.popularity_score, goods.media_url FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.popularity_score, goods.media_url FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "List id, good_id, profile_picture_url from customers.", "sql": null}, {"role": "assistant", "content": "SELECT id, good_id, profile_picture_url FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "List customers that have good_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, good_id, profile_picture_url FROM restaurant.customers WHERE good_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum birth_date for each birth_date in customers?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, SUM(birth_date) AS sum_birth_date FROM restaurant.customers GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Find customers where birth_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers WHERE birth_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by birth_date.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM restaurant.customers GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "What are the birth_date, id, state of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, id, state FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "What profile_picture_url, created_at, media_url, popularity_score do we have for customers and their associated goods?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, id, state, goods.media_url, goods.popularity_score FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id;", "sql": null}, {"role": "user", "content": "Group customers by profile_picture_url and show the min of state.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, MIN(state) AS min_state FROM restaurant.customers GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "List last_name, birth_date, popularity_score, media_url for each customer along with their good information.", "sql": null}, {"role": "assistant", "content": "SELECT *, goods.popularity_score, goods.media_url FROM restaurant.customers JOIN restaurant.goods ON customers.good_id = goods.item_id;", "sql": null}, {"role": "user", "content": "How many customers are there per last_name?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, COUNT(*) AS count FROM restaurant.customers GROUP BY last_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.goods (\n item_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n popularity_score char,\n media_url char\n)\n\nCREATE TABLE restaurant.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_name char,\n state character varying(128),\n profile_picture_url varchar,\n birth_date date NOT NULL,\n good_id text -- reference to goods.item_id,\n FOREIGN KEY (good_id) REFERENCES goods(item_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers;", "sql": null}, {"role": "user", "content": "Sort the results by good_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.customers ORDER BY good_id DESC;", "sql": null}, {"role": "user", "content": "How many customers are there per birth_date?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM restaurant.customers GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get tags, description, published_at from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT tags, description, published_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show the results sorted by parent_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT tags, description, published_at FROM socialmedia.posts ORDER BY parent_id ASC;", "sql": null}, {"role": "user", "content": "Calculate average of edited_at for each edited_at in posts.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, AVERAGE(edited_at) AS average_edited_at FROM socialmedia.posts GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get like_id, parent_id, city, username by joining posts with likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.city, likes.username FROM socialmedia.posts JOIN socialmedia.likes ON posts.like_id = likes.id;", "sql": null}, {"role": "user", "content": "Group posts by parent_id and show the min of description.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, MIN(description) AS min_description FROM socialmedia.posts GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List user_id, tags, is_verified, city for each post along with their like information.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.is_verified, likes.city FROM socialmedia.posts JOIN socialmedia.likes ON posts.like_id = likes.id;", "sql": null}, {"role": "user", "content": "Count the number of posts in each description category.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM socialmedia.posts GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Order the output by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different comment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.posts GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get image_url, comment_id, rating from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, comment_id, rating FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List parent_id, user_id, updated_at, timezone for each post along with their like information.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, comment_id, rating, likes.updated_at, likes.timezone FROM socialmedia.posts JOIN socialmedia.likes ON posts.like_id = likes.id;", "sql": null}, {"role": "user", "content": "How many posts are there per image_url?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM socialmedia.posts GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match comment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE comment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE comment_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the description, published_at, like_id of each post?", "sql": null}, {"role": "assistant", "content": "SELECT description, published_at, like_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT description, published_at, like_id FROM socialmedia.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group posts by parent_id and show the min of description.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, MIN(description) AS min_description FROM socialmedia.posts GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by rating ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Count the number of posts in each like_id category.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, COUNT(*) AS count FROM socialmedia.posts GROUP BY like_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n edited_at timestamp,\n rating varchar NOT NULL,\n tags varchar NOT NULL,\n user_id character varying(64),\n description char NOT NULL,\n image_url character varying(128),\n content character varying(128),\n parent_id character varying(128) -- identifier for parent,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n published_at timestamp without time zone,\n backorder character varying(256) NOT NULL,\n cost numeric,\n tax_rate character varying(256),\n thumbnail_url character varying(256),\n video_url character varying(128),\n currency varchar\n)\n\nCREATE TABLE socialmedia.likes (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n username text,\n timezone character varying(64),\n is_verified boolean -- indicates if verified is true,\n city text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List edited_at, user_id, is_verified, timezone for each post along with their like information.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.is_verified, likes.timezone FROM socialmedia.posts JOIN socialmedia.likes ON posts.like_id = likes.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by tags descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.is_verified, likes.timezone FROM socialmedia.posts JOIN socialmedia.likes ON posts.like_id = likes.id ORDER BY tags DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Get notes, approval_status, reference_number from all finances.", "sql": null}, {"role": "assistant", "content": "SELECT notes, approval_status, reference_number FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Arrange the results with item_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT notes, approval_status, reference_number FROM transportation.finances ORDER BY item_id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of finances grouped by item_id.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, COUNT(*) AS count FROM transportation.finances GROUP BY item_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Retrieve id, reference_number, payment_date for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT id, reference_number, payment_date FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Retrieve finances where reference_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, reference_number, payment_date FROM transportation.finances WHERE reference_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT id, reference_number, payment_date FROM transportation.finances WHERE reference_number LIKE 'A%' ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "What are the description, status, id of each finance?", "sql": null}, {"role": "assistant", "content": "SELECT description, status, id FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Show the results sorted by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, status, id FROM transportation.finances ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of finances across different notes values.", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM transportation.finances GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Get id, verification_status, payment_date from all finances.", "sql": null}, {"role": "assistant", "content": "SELECT id, verification_status, payment_date FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Show me vendor_id, id, popularity_score, msrp from finances and their related items.", "sql": null}, {"role": "assistant", "content": "SELECT id, verification_status, payment_date, items.popularity_score, items.msrp FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, verification_status, payment_date, items.popularity_score, items.msrp FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Retrieve notes, approval_status, popularity_score, rating showing the relationship between finances and items.", "sql": null}, {"role": "assistant", "content": "SELECT *, items.popularity_score, items.rating FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku;", "sql": null}, {"role": "user", "content": "Get max of verification_status by description from finances.", "sql": null}, {"role": "assistant", "content": "SELECT description, MAX(verification_status) AS max_verification_status FROM transportation.finances GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me item_id, approval_status, notes for all finances.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, approval_status, notes FROM transportation.finances;", "sql": null}, {"role": "user", "content": "What status, id, popularity_score, description do we have for finances and their associated items?", "sql": null}, {"role": "assistant", "content": "SELECT item_id, approval_status, notes, items.popularity_score, items.description FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku;", "sql": null}, {"role": "user", "content": "Tally up finances by verification_status.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM transportation.finances GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me description, vendor_id, payment_date for all finances.", "sql": null}, {"role": "assistant", "content": "SELECT description, vendor_id, payment_date FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Show me id, payment_date, popularity_score, subcategory from finances and their related items.", "sql": null}, {"role": "assistant", "content": "SELECT description, vendor_id, payment_date, items.popularity_score, items.subcategory FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku;", "sql": null}, {"role": "user", "content": "Count the number of finances in each vendor_id category.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM transportation.finances GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Get all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Show the results sorted by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.finances ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Tally up finances by notes.", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM transportation.finances GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me description, payment_date, verification_status for all finances.", "sql": null}, {"role": "assistant", "content": "SELECT description, payment_date, verification_status FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Show me finances with id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, payment_date, verification_status FROM transportation.finances WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT description, payment_date, verification_status FROM transportation.finances WHERE id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.items (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n rating char NOT NULL,\n msrp text,\n description character varying(128) NOT NULL,\n popularity_score character varying(64) NOT NULL,\n subcategory varchar\n)\n\nCREATE TABLE transportation.finances (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n verification_status character varying(256) NOT NULL,\n description text,\n vendor_id varchar,\n notes character varying(64),\n status text NOT NULL,\n approval_status char,\n reference_number varchar,\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE transportation.reservations (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n discount numeric,\n buyer_id character varying(128) -- identifier for buyer,\n approval_status character varying(128),\n product_id character varying(256) -- identifier for product\n)", "conversations": [{"role": "user", "content": "List item_id, verification_status, id from finances.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, verification_status, id FROM transportation.finances;", "sql": null}, {"role": "user", "content": "Get vendor_id, reference_number, popularity_score, rating by joining finances with items.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, verification_status, id, items.popularity_score, items.rating FROM transportation.finances JOIN transportation.items ON finances.item_id = items.sku;", "sql": null}, {"role": "user", "content": "What is the min reference_number for each notes in finances?", "sql": null}, {"role": "assistant", "content": "SELECT notes, MIN(reference_number) AS min_reference_number FROM transportation.finances GROUP BY notes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n views text,\n author_id character varying(128) -- identifier for author,\n media_url char,\n user_id text -- reference to users.customer_id,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id),\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n api_key char,\n token char NOT NULL,\n city varchar,\n display_name char,\n is_verified boolean\n)\n\nCREATE TABLE socialmedia.likes (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at date,\n image_url character varying(256),\n views text,\n media_url character varying(256),\n thumbnail character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n parent_id character varying(128) -- identifier for parent,\n tags text,\n attachment_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n coordinates character varying(128),\n state character varying(256),\n type character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY media_url DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY media_url DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n views text,\n author_id character varying(128) -- identifier for author,\n media_url char,\n user_id text -- reference to users.customer_id,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id),\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n api_key char,\n token char NOT NULL,\n city varchar,\n display_name char,\n is_verified boolean\n)\n\nCREATE TABLE socialmedia.likes (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at date,\n image_url character varying(256),\n views text,\n media_url character varying(256),\n thumbnail character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n parent_id character varying(128) -- identifier for parent,\n tags text,\n attachment_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n coordinates character varying(128),\n state character varying(256),\n type character varying(64)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE author_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n views text,\n author_id character varying(128) -- identifier for author,\n media_url char,\n user_id text -- reference to users.customer_id,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id),\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n api_key char,\n token char NOT NULL,\n city varchar,\n display_name char,\n is_verified boolean\n)\n\nCREATE TABLE socialmedia.likes (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at date,\n image_url character varying(256),\n views text,\n media_url character varying(256),\n thumbnail character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n parent_id character varying(128) -- identifier for parent,\n tags text,\n attachment_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n coordinates character varying(128),\n state character varying(256),\n type character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where like_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE like_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n views text,\n author_id character varying(128) -- identifier for author,\n media_url char,\n user_id text -- reference to users.customer_id,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id),\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n api_key char,\n token char NOT NULL,\n city varchar,\n display_name char,\n is_verified boolean\n)\n\nCREATE TABLE socialmedia.likes (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at date,\n image_url character varying(256),\n views text,\n media_url character varying(256),\n thumbnail character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n parent_id character varying(128) -- identifier for parent,\n tags text,\n attachment_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n coordinates character varying(128),\n state character varying(256),\n type character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the user_id, views, author_id of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, views, author_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with views in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, views, author_id FROM socialmedia.followers ORDER BY views ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by like_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, views, author_id FROM socialmedia.followers ORDER BY like_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n views text,\n author_id character varying(128) -- identifier for author,\n media_url char,\n user_id text -- reference to users.customer_id,\n like_id text NOT NULL -- reference to likes.id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id),\n FOREIGN KEY (like_id) REFERENCES likes(id)\n)\n\nCREATE TABLE socialmedia.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n api_key char,\n token char NOT NULL,\n city varchar,\n display_name char,\n is_verified boolean\n)\n\nCREATE TABLE socialmedia.likes (\n id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n edited_at date,\n image_url character varying(256),\n views text,\n media_url character varying(256),\n thumbnail character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.comments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n parent_id character varying(128) -- identifier for parent,\n tags text,\n attachment_url character varying(128)\n)\n\nCREATE TABLE socialmedia.groups (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n coordinates character varying(128),\n state character varying(256),\n type character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the views, updated_at, edited_at of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, edited_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, edited_at FROM socialmedia.followers ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, edited_at FROM socialmedia.followers ORDER BY user_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Get count of text by follower_id from likes.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(text) AS count_text FROM socialmedia.likes GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where follower_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE follower_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE follower_id LIKE 'A%' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Display all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "What follower_id, parent_id, address_line2, category do we have for likes and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.address_line2, followers.category FROM socialmedia.likes JOIN socialmedia.followers ON likes.follower_id = followers.id;", "sql": null}, {"role": "user", "content": "Get the distribution of likes across different follower_id values.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Show me image_url, updated_at, text for all likes.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, updated_at, text FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, updated_at, text FROM socialmedia.likes WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many likes are there per follower_id?", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "List parent_id, text, created_at from likes.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, text, created_at FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Arrange the results with follower_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, text, created_at FROM socialmedia.likes ORDER BY follower_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by text descending?", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, text, created_at FROM socialmedia.likes ORDER BY text DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by parent_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY parent_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Display all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve text, author_id, category, accessibility showing the relationship between likes and followers.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.category, followers.accessibility FROM socialmedia.likes JOIN socialmedia.followers ON likes.follower_id = followers.id;", "sql": null}, {"role": "user", "content": "Get sum of created_at by message_id from likes.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, SUM(created_at) AS sum_created_at FROM socialmedia.likes GROUP BY message_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of text for each parent_id in likes.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, SUM(text) AS sum_text FROM socialmedia.likes GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n accessibility text,\n address_line2 character varying(64),\n category character varying(256),\n country varchar NOT NULL,\n street character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.likes (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n image_url character varying(64),\n parent_id character varying(128) NOT NULL,\n text varchar,\n author_id character varying(64) NOT NULL -- identifier for author,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, parent_id, updated_at for every like.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parent_id, updated_at FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parent_id, updated_at FROM socialmedia.likes WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, parent_id, updated_at FROM socialmedia.likes WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Get user_id, updated_at, score from all content.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, score FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Can you order these by score descending?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, score FROM humanresources.content ORDER BY score DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, score FROM humanresources.content ORDER BY score DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Get all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Show me content with message LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE message LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with content_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE message LIKE 'A%' ORDER BY content_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "What are the user_id, content_id, tags of each content?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content_id, tags FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Get content_id, score, approval_status, updated_at by joining content with finances.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content_id, tags, finances.approval_status, finances.updated_at FROM humanresources.content JOIN humanresources.finances ON content.finance_id = finances.id;", "sql": null}, {"role": "user", "content": "Order the output by content_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, content_id, tags, finances.approval_status, finances.updated_at FROM humanresources.content JOIN humanresources.finances ON content.finance_id = finances.id ORDER BY content_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Get all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content;", "sql": null}, {"role": "user", "content": "List content that have finance_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE finance_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max user_id for each finance_id in content?", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, MAX(user_id) AS max_user_id FROM humanresources.content GROUP BY finance_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Show me format, user_id, finance_id for all content.", "sql": null}, {"role": "assistant", "content": "SELECT format, user_id, finance_id FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Retrieve content where tags LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT format, user_id, finance_id FROM humanresources.content WHERE tags LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT format, user_id, finance_id FROM humanresources.content WHERE tags LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Show me all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Sort the results by visibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content ORDER BY visibility ASC;", "sql": null}, {"role": "user", "content": "Tally up content by tags.", "sql": null}, {"role": "assistant", "content": "SELECT tags, COUNT(*) AS count FROM humanresources.content GROUP BY tags ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Show me all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Get all content created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many content are there per user_id?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM humanresources.content GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Get all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Retrieve content where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by content_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.content WHERE format LIKE 'A%' ORDER BY content_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "Retrieve text, tags, format for every content.", "sql": null}, {"role": "assistant", "content": "SELECT text, tags, format FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Show me content with content_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT text, tags, format FROM humanresources.content WHERE content_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of updated_at for each visibility in content.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, SUM(updated_at) AS sum_updated_at FROM humanresources.content GROUP BY visibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.finances (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n approval_status varchar NOT NULL,\n exchange_rate varchar NOT NULL,\n description char,\n amount numeric(38,14)\n)\n\nCREATE TABLE humanresources.content (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(128) NOT NULL,\n score char,\n text character varying(128),\n tags char,\n visibility character varying(128),\n format varchar,\n message character varying(64) NOT NULL,\n finance_id text NOT NULL -- reference to finances.id,\n FOREIGN KEY (finance_id) REFERENCES finances(id)\n)", "conversations": [{"role": "user", "content": "What are the user_id, message, score of each content?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, message, score FROM humanresources.content;", "sql": null}, {"role": "user", "content": "Retrieve content where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, message, score FROM humanresources.content WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate average of finance_id for each message in content.", "sql": null}, {"role": "assistant", "content": "SELECT message, AVERAGE(finance_id) AS average_finance_id FROM humanresources.content GROUP BY message;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with customer_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY customer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Show me the count of audits grouped by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM finance.audits GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve notes, customer_id, approval_status for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT notes, customer_id, approval_status FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits that have customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT notes, customer_id, approval_status FROM finance.audits WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of processed_at for each category in audits.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(processed_at) AS count_processed_at FROM finance.audits GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve customer_id, notes, approval_status for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, notes, approval_status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, notes, approval_status FROM finance.audits ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Count the number of audits in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM finance.audits GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "What are the subtotal, audit_id, customer_id of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, audit_id, customer_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve buyer_id, seller_id, category, approval_status showing the relationship between payments and audits.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, audit_id, customer_id, audits.category, audits.approval_status FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.account_id;", "sql": null}, {"role": "user", "content": "Show me max of seller_id grouped by seller_id for payments.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, MAX(seller_id) AS max_seller_id FROM finance.payments GROUP BY seller_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me seller_id, audit_id, subtotal for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, audit_id, subtotal FROM finance.payments;", "sql": null}, {"role": "user", "content": "Can you order these by invoice_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, audit_id, subtotal FROM finance.payments ORDER BY invoice_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with subtotal in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, audit_id, subtotal FROM finance.payments ORDER BY subtotal ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "List subtotal, completed_at, buyer_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, completed_at, buyer_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get tax, subtotal, processed_at, category by joining payments with audits.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, completed_at, buyer_id, audits.processed_at, audits.category FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.account_id;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, completed_at, buyer_id, audits.processed_at, audits.category FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.account_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "What fee, invoice_id, exchange_rate, approval_status do we have for payments and their associated audits?", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.exchange_rate, audits.approval_status FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.account_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.exchange_rate, audits.approval_status FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.account_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n exchange_rate text NOT NULL,\n approval_status char NOT NULL,\n category character varying(256) NOT NULL,\n notes character varying(64),\n customer_id text -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n account_status character varying(128) NOT NULL,\n bio character varying(64) NOT NULL,\n status character varying(128)\n)\n\nCREATE TABLE finance.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n price smallint,\n tax integer,\n seller_id varchar,\n subtotal integer NOT NULL,\n buyer_id varchar -- identifier for buyer,\n account_id text -- identifier for account,\n fee character varying(128),\n audit_id text NOT NULL -- reference to audits.account_id,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (audit_id) REFERENCES audits(account_id),\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY approval_status DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the billin_id, exchange_rate, reference_number of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, exchange_rate, reference_number FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, exchange_rate, reference_number FROM healthcare.doctors WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, exchange_rate, reference_number FROM healthcare.doctors WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me approval_status, verification_status, reference_number for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reference_number FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reference_number FROM healthcare.doctors WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reference_number FROM healthcare.doctors WHERE verification_status LIKE 'A%' ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the last_name, password_hash, billin_id of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, password_hash, billin_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where billin_id > 20.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, password_hash, billin_id FROM healthcare.patients WHERE billin_id > 20;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, password_hash, billin_id FROM healthcare.patients WHERE billin_id > 20 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List approval_status, verification_status, reconciliation_status from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status FROM healthcare.doctors WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status FROM healthcare.doctors WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, verification_status, reconciliation_status for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me reconciliation_status, description, thumbnail, shares from doctors and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status, billing.thumbnail, billing.shares FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by verification_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, reconciliation_status, billing.thumbnail, billing.shares FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.id ORDER BY verification_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve password_hash, joined_at, billin_id for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, joined_at, billin_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by joined_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, joined_at, billin_id FROM healthcare.patients ORDER BY joined_at ASC;", "sql": null}, {"role": "user", "content": "What is the sum billin_id for each joined_at in patients?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, SUM(billin_id) AS sum_billin_id FROM healthcare.patients GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me billin_id, last_name, is_active for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, last_name, is_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List joined_at, last_name, updated_at, content for each patient along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, last_name, is_active, billing.updated_at, billing.content FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, last_name, is_active, billing.updated_at, billing.content FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up patients by billin_id.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, COUNT(*) AS count FROM healthcare.patients GROUP BY billin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve billin_id, joined_at, password_hash for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, joined_at, password_hash FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients with last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, joined_at, password_hash FROM healthcare.patients WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of joined_at for each joined_at in patients.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, AVERAGE(joined_at) AS average_joined_at FROM healthcare.patients GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n verification_status text,\n reconciliation_status char,\n approval_status varchar,\n reference_number text,\n description text,\n exchange_rate character varying(128) NOT NULL,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_name character varying(256),\n password_hash character varying(128) NOT NULL,\n is_active boolean -- indicates if active is true,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(256),\n format character varying(64),\n subject character varying(64),\n thumbnail character varying(128),\n shares character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get all patients from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up patients by password_hash.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM healthcare.patients GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "Get card_type, payment_status, traded_at from all sales.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, payment_status, traded_at FROM banking.sales;", "sql": null}, {"role": "user", "content": "Retrieve sales where finance_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, payment_status, traded_at FROM banking.sales WHERE finance_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of sales across different payment_status values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM banking.sales GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "Show me all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Show me quantity, payment_status, payee_id, notes from sales and their related finances.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.payee_id, finances.notes FROM banking.sales JOIN banking.finances ON sales.finance_id = finances.payment_id;", "sql": null}, {"role": "user", "content": "Group sales by card_type and show the min of finance_id.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MIN(finance_id) AS min_finance_id FROM banking.sales GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, verification_status, status for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, verification_status, status FROM banking.finances;", "sql": null}, {"role": "user", "content": "Find finances created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, verification_status, status FROM banking.finances WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many finances are there per status?", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM banking.finances GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Retrieve sales where quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of product_id for each quantity in sales.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, AVERAGE(product_id) AS average_product_id FROM banking.sales GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "What are the product_id, payment_status, finance_id of each sale?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, finance_id FROM banking.sales;", "sql": null}, {"role": "user", "content": "Retrieve sales where card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, finance_id FROM banking.sales WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, finance_id FROM banking.sales WHERE card_type LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Retrieve finance_id, card_type, exchange_rate, created_at showing the relationship between sales and finances.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.exchange_rate, finances.created_at FROM banking.sales JOIN banking.finances ON sales.finance_id = finances.payment_id;", "sql": null}, {"role": "user", "content": "What is the sum product_id for each payment_status in sales?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, SUM(product_id) AS sum_product_id FROM banking.sales GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "List notes, verification_status, created_at from finances.", "sql": null}, {"role": "assistant", "content": "SELECT notes, verification_status, created_at FROM banking.finances;", "sql": null}, {"role": "user", "content": "Find finances where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT notes, verification_status, created_at FROM banking.finances WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of finances in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM banking.finances GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "Get product_id, payment_status, card_type from all sales.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, card_type FROM banking.sales;", "sql": null}, {"role": "user", "content": "Show me sales with finance_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, card_type FROM banking.sales WHERE finance_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, payment_status, card_type FROM banking.sales WHERE finance_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales;", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.sales ORDER BY product_id DESC;", "sql": null}, {"role": "user", "content": "Get sum of product_id by quantity from sales.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, SUM(product_id) AS sum_product_id FROM banking.sales GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.sales (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_status character varying(256),\n card_type text NOT NULL,\n quantity char,\n product_id char,\n finance_id text NOT NULL -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)\n\nCREATE TABLE banking.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at timestamp without time zone,\n exchange_rate character varying(256),\n status character varying(256),\n verification_status text,\n notes text NOT NULL,\n payee_id character varying(64) NOT NULL,\n reference_number character varying(256) NOT NULL,\n sale_id text -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)", "conversations": [{"role": "user", "content": "List reference_number, verification_status, sale_id from finances.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, verification_status, sale_id FROM banking.finances;", "sql": null}, {"role": "user", "content": "Retrieve finances where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, verification_status, sale_id FROM banking.finances WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of finances across different reference_number values.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, COUNT(*) AS count FROM banking.finances GROUP BY reference_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group departments by accessibility and show the count of location_lat.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(location_lat) AS count_location_lat FROM education.departments GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "List last_inspected, updated_at, name from departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, updated_at, name FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, updated_at, name FROM education.departments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of departments in each parking_available category.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM education.departments GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY parking_available ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different last_inspected values.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM education.enrollments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Get departments that match street LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE street LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of departments in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM education.departments GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Retrieve coordinates, address_id, department_id for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, address_id, department_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, address_id, department_id FROM education.enrollments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, address_id, department_id FROM education.enrollments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Order the output by parking_available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY parking_available DESC;", "sql": null}, {"role": "user", "content": "Sort the results by street descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY street DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where student_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE student_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max name for each street in departments?", "sql": null}, {"role": "assistant", "content": "SELECT street, MAX(name) AS max_name FROM education.departments GROUP BY street;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List timezone, accessibility, country, created_at for each department along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.country, students.created_at FROM education.departments JOIN education.students ON departments.student_id = students.id;", "sql": null}, {"role": "user", "content": "Arrange the results with name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.country, students.created_at FROM education.departments JOIN education.students ON departments.student_id = students.id ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(64),\n street varchar,\n location_lon character varying(256),\n coordinates character varying(64),\n department_id text -- reference to departments.venue_id,\n FOREIGN KEY (department_id) REFERENCES departments(venue_id)\n)\n\nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n username character varying(64) NOT NULL,\n nationality character varying(256),\n country varchar NOT NULL,\n is_active boolean,\n phone character varying(128) NOT NULL,\n language character varying(128),\n age char\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lat character varying(256),\n parking_available character varying(256),\n operating_hours character varying(256),\n street character varying(256),\n timezone varchar,\n accessibility char NOT NULL,\n name character varying(128),\n student_id text NOT NULL -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me operating_hours, parking_available, nationality, username from departments and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.nationality, students.username FROM education.departments JOIN education.students ON departments.student_id = students.id;", "sql": null}, {"role": "user", "content": "Tally up departments by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM education.departments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE username LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, debit, last_active, username showing the relationship between accounts and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_active, customers.username FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_active, customers.username FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get verification_status, payment_id, customer_id from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payment_id, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List due_date, approval_status, username, membership_level for each account along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payment_id, customer_id, customers.username, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payment_id, customer_id, customers.username, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What payment_id, verification_status, transaction_id, membership_level do we have for accounts and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.transaction_id, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.transaction_id, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get account_status, last_active, membership_level from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, last_active, membership_level FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with account_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, last_active, membership_level FROM finance.customers WHERE account_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count api_key for each account_status in customers?", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(api_key) AS count_api_key FROM finance.customers GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM finance.accounts GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with membership_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE membership_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by transaction_id.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM finance.customers GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Show me due_date, verification_status, customer_id for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, verification_status, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, verification_status, customer_id FROM finance.accounts WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.accounts GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n verification_status text,\n debit char NOT NULL,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n quantity character varying(128) NOT NULL,\n customer_id text -- identifier for customer,\n card_type text NOT NULL\n)\n\nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active date,\n status character varying(64),\n display_name char NOT NULL,\n username varchar NOT NULL,\n api_key character varying(64) NOT NULL,\n account_status character varying(64) NOT NULL,\n membership_level character varying(128),\n transaction_id integer NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What payment_id, verification_status, api_key, membership_level do we have for accounts and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.api_key, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different payment_id values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM finance.accounts GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Get featured_rank, assignment_id, manufacturer from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, assignment_id, manufacturer FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, assignment_id, manufacturer FROM education.grades WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the count created_at for each popularity_score in grades?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(created_at) AS count_created_at FROM education.grades GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Get grades that match manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different expires_at values.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM education.grades GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by backorder ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY backorder ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me assignment_id, tax_rate, published_at, updated_at from grades and their related assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.published_at, assignments.updated_at FROM education.grades JOIN education.assignments ON grades.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.published_at, assignments.updated_at FROM education.grades JOIN education.assignments ON grades.assignment_id = assignments.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Get tax_rate, created_at, name from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, created_at, name FROM education.grades;", "sql": null}, {"role": "user", "content": "What assignment_id, expires_at, grade_id, published_at do we have for grades and their associated assignments?", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, created_at, name, assignments.grade_id, assignments.published_at FROM education.grades JOIN education.assignments ON grades.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Get average of popularity_score by manufacturer from grades.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, AVERAGE(popularity_score) AS average_popularity_score FROM education.grades GROUP BY manufacturer;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Show me grade_id, rating, published_at for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, rating, published_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me backorder, rating, name, assignment_id from assignments and their related grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, rating, published_at, grades.name, grades.assignment_id FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.item_id;", "sql": null}, {"role": "user", "content": "Group assignments by rating and show the sum of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT rating, SUM(published_at) AS sum_published_at FROM education.assignments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "What are the published_at, grade_id, rating of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, grade_id, rating FROM education.assignments;", "sql": null}, {"role": "user", "content": "Arrange the results with grade_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, grade_id, rating FROM education.assignments ORDER BY grade_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of assignments across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.assignments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve expires_at, assignment_id, manufacturer for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, assignment_id, manufacturer FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, assignment_id, manufacturer FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, assignment_id, manufacturer FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "Show me backorder, grade_id, rating for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, grade_id, rating FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, grade_id, rating FROM education.assignments ORDER BY subcategory DESC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, grade_id, rating FROM education.assignments ORDER BY subcategory DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n name character varying(128) NOT NULL,\n popularity_score char NOT NULL,\n featured_rank char NOT NULL,\n video_url character varying(128),\n manufacturer character varying(128) NOT NULL,\n tax_rate character varying(256),\n assignment_id text NOT NULL -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n backorder character varying(256) NOT NULL,\n subcategory character varying(256),\n rating char,\n grade_id text NOT NULL -- reference to grades.item_id,\n FOREIGN KEY (grade_id) REFERENCES grades(item_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE updated_at > '2023-01-01' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me website, last_active, salt for all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT website, last_active, salt FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get last_active, person_id, debit, approval_status by joining medical_records with billing.", "sql": null}, {"role": "assistant", "content": "SELECT website, last_active, salt, billing.debit, billing.approval_status FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Group medical_records by website and show the min of is_verified.", "sql": null}, {"role": "assistant", "content": "SELECT website, MIN(is_verified) AS min_is_verified FROM healthcare.medical_records GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "What are the username, billin_id, updated_at of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT username, billin_id, updated_at FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List last_name, display_name, debit, updated_at for each patient along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT username, billin_id, updated_at, billing.debit, billing.updated_at FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT username, billin_id, updated_at, billing.debit, billing.updated_at FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records where website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of medical_records grouped by website.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(*) AS count FROM healthcare.medical_records GROUP BY website ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me person_id, country, nationality for all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, country, nationality FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, country, nationality FROM healthcare.medical_records ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, country, nationality FROM healthcare.medical_records ORDER BY updated_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve medical_records where billin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE billin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of last_active for each updated_at in medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(last_active) AS count_last_active FROM healthcare.medical_records GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve username, avatar, approval_status, debit showing the relationship between patients and billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.approval_status, billing.debit FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "What is the max last_name for each updated_at in patients?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(last_name) AS max_last_name FROM healthcare.patients GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "What are the last_active, updated_at, avatar of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, avatar FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me username, billin_id, updated_at, vendor_id from patients and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, avatar, billing.updated_at, billing.vendor_id FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by birth_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, avatar, billing.updated_at, billing.vendor_id FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id ORDER BY birth_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "What are the billin_id, website, updated_at of each medical_record?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, website, updated_at FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by person_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, website, updated_at FROM healthcare.medical_records ORDER BY person_id ASC;", "sql": null}, {"role": "user", "content": "How many medical_records are there per country?", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM healthcare.medical_records GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me display_name, username, updated_at for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, username, updated_at FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by last_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT display_name, username, updated_at FROM healthcare.patients ORDER BY last_name ASC;", "sql": null}, {"role": "user", "content": "Get sum of display_name by billin_id from patients.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, SUM(display_name) AS sum_display_name FROM healthcare.patients GROUP BY billin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n nationality character varying(64),\n country char,\n salt text,\n website character varying(128),\n is_verified bit,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n avatar character varying(128),\n last_name varchar,\n username text,\n birth_date date,\n display_name character varying(64),\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n debit char,\n vendor_id character varying(256) NOT NULL -- identifier for vendor,\n approval_status text\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "What avatar, billin_id, vendor_id, approval_status do we have for patients and their associated billing?", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.vendor_id, billing.approval_status FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.vendor_id, billing.approval_status FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Get zip_code, category, name from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, category, name FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "What updated_at, timezone, fee, total do we have for shipping and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, category, name, orders.fee, orders.total FROM e-commerce.shipping JOIN e-commerce.orders ON shipping.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "How many shipping are there per zip_code?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(*) AS count FROM e-commerce.shipping GROUP BY zip_code ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Calculate max of state for each order_id in shipping.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, MAX(state) AS max_state FROM e-commerce.shipping GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Get zip_code, order_id, venue_id from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, order_id, venue_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Order the output by order_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, order_id, venue_id FROM e-commerce.shipping ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Group shipping by category and show the average of state.", "sql": null}, {"role": "assistant", "content": "SELECT category, AVERAGE(state) AS average_state FROM e-commerce.shipping GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE order_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "List name, state, timezone from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT name, state, timezone FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT name, state, timezone FROM e-commerce.shipping WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT name, state, timezone FROM e-commerce.shipping WHERE updated_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me timezone, venue_id, order_id for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, venue_id, order_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "What venue_id, category, created_at, completed_at do we have for shipping and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, venue_id, order_id, orders.created_at, orders.completed_at FROM e-commerce.shipping JOIN e-commerce.orders ON shipping.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Tally up shipping by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve state, zip_code, category for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT state, zip_code, category FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get all shipping from last week.", "sql": null}, {"role": "assistant", "content": "SELECT state, zip_code, category FROM e-commerce.shipping WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT state, zip_code, category FROM e-commerce.shipping WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get shipping that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE updated_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, name, timezone for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, name, timezone FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Arrange the results with zip_code in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, name, timezone FROM e-commerce.shipping ORDER BY zip_code ASC;", "sql": null}, {"role": "user", "content": "Show me the count of shipping grouped by venue_id.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, COUNT(*) AS count FROM e-commerce.shipping GROUP BY venue_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n name character varying(64) NOT NULL,\n timezone varchar,\n zip_code varchar NOT NULL,\n state varchar,\n category varchar NOT NULL,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n total numeric,\n fee text NOT NULL,\n card_type character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the category, venue_id, zip_code of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT category, venue_id, zip_code FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, venue_id, zip_code FROM e-commerce.shipping WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up shipping by state.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM e-commerce.shipping GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, backorder, media_url for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, media_url FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve brand, user_id, inventor_id, username showing the relationship between inventory and users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, media_url, users.inventor_id, users.username FROM e-commerce.inventory JOIN e-commerce.users ON inventory.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, backorder, media_url, users.inventor_id, users.username FROM e-commerce.inventory JOIN e-commerce.users ON inventory.user_id = users.customer_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get inventor_id, username, status from all users.", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, username, status FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Arrange the results with account_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, username, status FROM e-commerce.users ORDER BY account_status DESC;", "sql": null}, {"role": "user", "content": "Tally up users by account_status.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(*) AS count FROM e-commerce.users GROUP BY account_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve inventory where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of inventory in each currency category.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM e-commerce.inventory GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List quantity, payment_status, updated_at, brand for each order along with their inventory information.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.updated_at, inventory.brand FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "How many orders are there per subtotal?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM e-commerce.orders GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Order the output by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by inventor_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY inventor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, buyer_id, subtotal from orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, subtotal FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, subtotal FROM e-commerce.orders ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, subtotal FROM e-commerce.orders ORDER BY updated_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the inventor_id, currency, quantity of each order?", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, currency, quantity FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What currency, inventor_id, user_id, tax_rate do we have for orders and their associated inventory?", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, currency, quantity, inventory.user_id, inventory.tax_rate FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT inventor_id, currency, quantity, inventory.user_id, inventory.tax_rate FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.barcode ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List account_status, inventor_id, username from users.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, inventor_id, username FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "List users that have status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, inventor_id, username FROM e-commerce.users WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up users by gender.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM e-commerce.users GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get account_status, status, joined_at from all users.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, joined_at FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get username, account_status, user_id, backorder by joining users with inventory.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, joined_at, inventory.user_id, inventory.backorder FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, status, joined_at, inventory.user_id, inventory.backorder FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256) NOT NULL,\n payment_status character varying(256),\n subtotal integer,\n buyer_id character varying(256) -- identifier for buyer,\n currency char,\n quantity text NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n account_status varchar NOT NULL,\n gender character varying(256),\n status character varying(128) NOT NULL,\n username character varying(64),\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n backorder text NOT NULL,\n currency char,\n tax_rate character varying(128) NOT NULL,\n brand text,\n media_url char NOT NULL,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the gender, account_status, status of each user?", "sql": null}, {"role": "assistant", "content": "SELECT gender, account_status, status FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT gender, account_status, status FROM e-commerce.users WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by username.", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(*) AS count FROM e-commerce.users GROUP BY username ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY amount ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different fee values.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM e-commerce.orders GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE transaction_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Get transaction_id, shippin_id, cancelled_at from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, shippin_id, cancelled_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What amount, cancelled_at, created_at, payee_id do we have for orders and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, shippin_id, cancelled_at, shipping.created_at, shipping.payee_id FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, shippin_id, cancelled_at, shipping.created_at, shipping.payee_id FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve card_type, transaction_id, credit, updated_at showing the relationship between orders and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.credit, shipping.updated_at FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.credit, shipping.updated_at FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up orders by fee.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM e-commerce.orders GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the status, card_type, cancelled_at of each order?", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, cancelled_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What traded_at, user_id, debit, status do we have for orders and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, cancelled_at, shipping.debit, shipping.status FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, cancelled_at, shipping.debit, shipping.status FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List amount, fee, created_at, payee_id for each order along with their shipping information.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.created_at, shipping.payee_id FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.created_at, shipping.payee_id FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by fee ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY fee ASC;", "sql": null}, {"role": "user", "content": "Can you order these by transaction_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY transaction_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n user_id char,\n card_type varchar,\n status text NOT NULL,\n fee char NOT NULL,\n amount smallint,\n subtotal bigint NOT NULL,\n shippin_id text NOT NULL -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n payee_id character varying(256),\n credit text NOT NULL,\n debit character varying(64),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n tax_rate varchar,\n title character varying(256),\n currency character varying(64),\n subcategory text\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n keywords text,\n attachment_url character varying(64),\n score character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY transaction_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_id, updated_at, created_at, fee showing the relationship between order_items and orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.created_at, orders.fee FROM e-commerce.order_items JOIN e-commerce.orders ON order_items.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Count the number of order_items in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM e-commerce.order_items GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the location_lat, updated_at, longitude of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, updated_at, longitude FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by order_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, updated_at, longitude FROM e-commerce.order_items ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of order_items in each operating_hours category.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM e-commerce.order_items GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of parking_available grouped by order_id for order_items.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, MAX(parking_available) AS max_parking_available FROM e-commerce.order_items GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List location_lat, longitude, type from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, longitude, type FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, longitude, type FROM e-commerce.order_items WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, longitude, type FROM e-commerce.order_items WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List longitude, parking_available, store_id from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, parking_available, store_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Can you order these by type descending?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, parking_available, store_id FROM e-commerce.order_items ORDER BY type DESC;", "sql": null}, {"role": "user", "content": "Can you order these by type descending?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, parking_available, store_id FROM e-commerce.order_items ORDER BY type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List parking_available, order_id, updated_at, card_type for each order_item along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.updated_at, orders.card_type FROM e-commerce.order_items JOIN e-commerce.orders ON order_items.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Tally up order_items by operating_hours.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM e-commerce.order_items GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE order_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n views varchar,\n video_url character varying(128) -- identifier for video_url,\n stock_level varchar NOT NULL,\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n delivery_status text,\n exchange_rate text NOT NULL,\n card_type character varying(128),\n fee character varying(128),\n tax numeric NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n location_lat char,\n parking_available character varying(256),\n type char,\n operating_hours char,\n longitude character varying(256) NOT NULL,\n order_id text NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at date,\n video_url character varying(64) -- identifier for video_url,\n thumbnail_url char,\n featured_rank character varying(64),\n price decimal,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Can you order these by last_inspected descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Tally up locations by country.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM music.locations GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Show me street, store_id, reconciliation_status, exchange_rate from locations and their related finances.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.reconciliation_status, finances.exchange_rate FROM music.locations JOIN music.finances ON locations.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "How many locations are there per finance_id?", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, COUNT(*) AS count FROM music.locations GROUP BY finance_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get store_id, name, country from all locations.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, name, country FROM music.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, name, country FROM music.locations WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different last_inspected values.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM music.locations GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "List locations that have finance_id > 66.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE finance_id > 66;", "sql": null}, {"role": "user", "content": "Get count of last_inspected by created_at from locations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(last_inspected) AS count_last_inspected FROM music.locations GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where street LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE street LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE street LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "List created_at, store_id, reconciliation_status, processed_at for each location along with their finance information.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.reconciliation_status, finances.processed_at FROM music.locations JOIN music.finances ON locations.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "Show me the count of locations grouped by store_id.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(*) AS count FROM music.locations GROUP BY store_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Show me locations that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' ORDER BY name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Show me locations with name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations WHERE name LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Retrieve name, finance_id, exchange_rate, reconciliation_status showing the relationship between locations and finances.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.exchange_rate, finances.reconciliation_status FROM music.locations JOIN music.finances ON locations.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.exchange_rate, finances.reconciliation_status FROM music.locations JOIN music.finances ON locations.finance_id = finances.account_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.locations (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_inspected date,\n street char,\n name varchar NOT NULL,\n country text,\n state char,\n finance_id integer -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE music.finances (\n account_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n exchange_rate character varying(128),\n reconciliation_status text,\n invoice_number character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.locations;", "sql": null}, {"role": "user", "content": "Show me name, finance_id, invoice_number, processed_at from locations and their related finances.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.invoice_number, finances.processed_at FROM music.locations JOIN music.finances ON locations.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "Show me min of finance_id grouped by country for locations.", "sql": null}, {"role": "assistant", "content": "SELECT country, MIN(finance_id) AS min_finance_id FROM music.locations GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List payment_id, approval_status, customer_id, card_type for each audit along with their payment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.customer_id, payments.card_type FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.id;", "sql": null}, {"role": "user", "content": "Order the output by payment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.customer_id, payments.card_type FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.id ORDER BY payment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me email, city, longitude, state from customers and their related investments.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.longitude, investments.state FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.longitude, investments.state FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Can you order these by card_type descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY card_type DESC;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by total.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM finance.payments GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by investment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY investment_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by last_login descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY last_login DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Arrange the results with card_type in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY card_type ASC;", "sql": null}, {"role": "user", "content": "Get max of card_type by account_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, MAX(card_type) AS max_card_type FROM finance.payments GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_login > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_login > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Show me investment_id, email, last_name for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, email, last_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with city in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, email, last_name FROM finance.customers ORDER BY city DESC;", "sql": null}, {"role": "user", "content": "How many customers are there per investment_id?", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, COUNT(*) AS count FROM finance.customers GROUP BY investment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Get investment_id, last_login, joined_at from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, last_login, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers that have email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, last_login, joined_at FROM finance.customers WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of phone grouped by email for customers.", "sql": null}, {"role": "assistant", "content": "SELECT email, MIN(phone) AS min_phone FROM finance.customers GROUP BY email;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login timestamp,\n city character varying(64),\n phone text NOT NULL,\n last_name text,\n email char,\n investment_id text -- reference to investments.id,\n FOREIGN KEY (investment_id) REFERENCES investments(id)\n)\n\nCREATE TABLE finance.audits (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n exchange_rate char,\n verification_status character varying(256) NOT NULL,\n payment_id integer NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id text -- identifier for account,\n total numeric(38,14),\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.investments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n country varchar NOT NULL,\n operating_hours text,\n longitude char,\n timezone character varying(64),\n state character varying(64),\n category varchar\n)", "conversations": [{"role": "user", "content": "What are the total, card_type, account_id of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT total, card_type, account_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT total, card_type, account_id FROM finance.payments WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by account_id.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.payments GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Get status, debit, created_at from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT status, debit, created_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT status, debit, created_at FROM healthcare.billing ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM healthcare.billing GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Retrieve author_id, message, updated_at for every department.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, message, updated_at FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, message, updated_at FROM healthcare.departments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, message, updated_at FROM healthcare.departments WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.billing GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Get amount, status, debit from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT amount, status, debit FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT amount, status, debit FROM healthcare.billing WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT amount, status, debit FROM healthcare.billing WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Calculate count of published_at for each published_at in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(published_at) AS count_published_at FROM healthcare.prescriptions GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "What are the message, updated_at, author_id of each department?", "sql": null}, {"role": "assistant", "content": "SELECT message, updated_at, author_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT message, updated_at, author_id FROM healthcare.departments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different attachment_url values.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, COUNT(*) AS count FROM healthcare.departments GROUP BY attachment_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Get user_id, updated_at, created_at from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, created_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, created_at FROM healthcare.billing WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group billing by amount and show the sum of status.", "sql": null}, {"role": "assistant", "content": "SELECT amount, SUM(status) AS sum_status FROM healthcare.billing GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions with attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE attachment_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different debit values.", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM healthcare.billing GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n user_id text NOT NULL,\n debit character varying(256),\n amount integer,\n customer_id varchar,\n status char\n)\n\nCREATE TABLE healthcare.departments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n attachment_url text,\n author_id text,\n message character varying(256)\n)\n\nCREATE TABLE healthcare.prescriptions (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n rating character varying(256),\n user_id varchar,\n attachment_url char NOT NULL,\n parent_id char NOT NULL -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List user_id, parent_id, attachment_url from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, parent_id, attachment_url FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match comment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, parent_id, attachment_url FROM healthcare.prescriptions WHERE comment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up prescriptions by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at date,\n subtotal integer NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n approval_status varchar,\n loan_id text -- reference to loans.order_id,\n FOREIGN KEY (loan_id) REFERENCES loans(order_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n tax bigint NOT NULL,\n product_id character varying(256) -- identifier for product,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_inspected date,\n location_lon varchar NOT NULL,\n name text,\n latitude character varying(64),\n accessibility char\n)\n\nCREATE TABLE finance.loans (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n updated_at date,\n card_type text NOT NULL,\n quantity character varying(64),\n status text,\n customer_id char,\n delivery_status text\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n created_at date,\n api_key character varying(128),\n birth_date date,\n website character varying(256),\n status char,\n last_name varchar NOT NULL,\n country text\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by subtotal ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at > '2023-12-01' ORDER BY subtotal ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at date,\n subtotal integer NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n approval_status varchar,\n loan_id text -- reference to loans.order_id,\n FOREIGN KEY (loan_id) REFERENCES loans(order_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n tax bigint NOT NULL,\n product_id character varying(256) -- identifier for product,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_inspected date,\n location_lon varchar NOT NULL,\n name text,\n latitude character varying(64),\n accessibility char\n)\n\nCREATE TABLE finance.loans (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n updated_at date,\n card_type text NOT NULL,\n quantity character varying(64),\n status text,\n customer_id char,\n delivery_status text\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n created_at date,\n api_key character varying(128),\n birth_date date,\n website character varying(256),\n status char,\n last_name varchar NOT NULL,\n country text\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE invoice_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n traded_at date,\n subtotal integer NOT NULL,\n customer_id character varying(64) -- identifier for customer,\n approval_status varchar,\n loan_id text -- reference to loans.order_id,\n FOREIGN KEY (loan_id) REFERENCES loans(order_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n tax bigint NOT NULL,\n product_id character varying(256) -- identifier for product,\n approval_status character varying(256),\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_inspected date,\n location_lon varchar NOT NULL,\n name text,\n latitude character varying(64),\n accessibility char\n)\n\nCREATE TABLE finance.loans (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n updated_at date,\n card_type text NOT NULL,\n quantity character varying(64),\n status text,\n customer_id char,\n delivery_status text\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n created_at date,\n api_key character varying(128),\n birth_date date,\n website character varying(256),\n status char,\n last_name varchar NOT NULL,\n country text\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by product_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY product_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY product_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions where customer_id > 79.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE customer_id > 79;", "sql": null}, {"role": "user", "content": "Calculate min of processed_at for each payment_id in transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, MIN(processed_at) AS min_processed_at FROM finance.transactions GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me status, customer_id, payment_id for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, payment_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get customer_id, status, account_status, city by joining transactions with customers.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, payment_id, customers.account_status, customers.city FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Tally up transactions by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.transactions GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up transactions by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.transactions GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY payment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM finance.transactions GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by payment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "List payment_id, processed_at, payment_status from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, processed_at, payment_status FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions that have customer_id > 99.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, processed_at, payment_status FROM finance.transactions WHERE customer_id > 99;", "sql": null}, {"role": "user", "content": "Group transactions by customer_id and show the max of status.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(status) AS max_status FROM finance.transactions GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me status, customer_id, payment_status for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, payment_status FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, payment_status FROM finance.transactions WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by customer_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, payment_status FROM finance.transactions WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY customer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Get customer_id, payment_id, payment_status from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, payment_status FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me customer_id, processed_at, joined_at, updated_at from transactions and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, payment_status, customers.joined_at, customers.updated_at FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_id, payment_status, customers.joined_at, customers.updated_at FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.customer_id ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at date,\n salt varchar NOT NULL,\n account_status character varying(256),\n city varchar NOT NULL,\n last_login timestamp NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n status char,\n payment_status varchar,\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up transactions by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.transactions GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "List discount, delivery_status, payment_status from payments.", "sql": null}, {"role": "assistant", "content": "SELECT discount, delivery_status, payment_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT discount, delivery_status, payment_status FROM finance.payments WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the sum audit_id for each payment_status in payments?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, SUM(audit_id) AS sum_audit_id FROM finance.payments GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me last_active, last_name, first_name for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_name, first_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Order the output by payment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_name, first_name FROM finance.customers ORDER BY payment_id DESC;", "sql": null}, {"role": "user", "content": "How many customers are there per first_name?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM finance.customers GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "What last_name, last_login, audit_id, cancelled_at do we have for customers and their associated payments?", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.audit_id, payments.cancelled_at FROM finance.customers JOIN finance.payments ON customers.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different last_login values.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, COUNT(*) AS count FROM finance.customers GROUP BY last_login ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "List completed_at, discount, cancelled_at from payments.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, discount, cancelled_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, payment_status, first_name, last_login showing the relationship between payments and customers.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, discount, cancelled_at, customers.first_name, customers.last_login FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by discount.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM finance.payments GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the first_name, last_active, payment_id of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_active, payment_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve last_active, last_login, customer_id, delivery_status showing the relationship between customers and payments.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_active, payment_id, payments.customer_id, payments.delivery_status FROM finance.customers JOIN finance.payments ON customers.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_active, payment_id, payments.customer_id, payments.delivery_status FROM finance.customers JOIN finance.payments ON customers.payment_id = payments.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different audit_id values.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, COUNT(*) AS count FROM finance.payments GROUP BY audit_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get payment_status, discount, completed_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, discount, completed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get customer_id, payment_status, username, last_active by joining payments with customers.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, discount, completed_at, customers.username, customers.last_active FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "What is the sum completed_at for each customer_id in payments?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, SUM(completed_at) AS sum_completed_at FROM finance.payments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get payment_status, audit_id, completed_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, audit_id, completed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, audit_id, completed_at FROM finance.payments ORDER BY payment_status ASC;", "sql": null}, {"role": "user", "content": "Can you order these by payment_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, audit_id, completed_at FROM finance.payments ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me cancelled_at, payment_status, completed_at for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_status, completed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match discount > 16.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_status, completed_at FROM finance.payments WHERE discount > 16;", "sql": null}, {"role": "user", "content": "Can you order these by audit_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_status, completed_at FROM finance.payments WHERE discount > 16 ORDER BY audit_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n username text,\n last_name varchar,\n last_login timestamp NOT NULL,\n first_name text,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n total numeric(38,14),\n price bigint,\n payment_status character varying(256),\n exchange_rate character varying(256),\n customer_id char NOT NULL,\n subtotal numeric(38,14)\n)\n\nCREATE TABLE finance.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n cancelled_at timestamp,\n payment_status character varying(256) NOT NULL,\n discount numeric(38,14),\n delivery_status character varying(64) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n audit_id integer -- reference to audits.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id),\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY discount ASC;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by completed_at.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(*) AS count FROM finance.payments GROUP BY completed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me address, created_at, transaction_id for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT address, created_at, transaction_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with employee_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT address, created_at, transaction_id FROM finance.customers ORDER BY employee_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT address, created_at, transaction_id FROM finance.customers ORDER BY employee_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve transaction_id, created_at, website for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, created_at, website FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers from last week.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, created_at, website FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, created_at, website FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by website descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY website DESC;", "sql": null}, {"role": "user", "content": "Calculate count of created_at for each transaction_id in customers.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(created_at) AS count_created_at FROM finance.customers GROUP BY transaction_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, employee_id, transaction_id for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, employee_id, transaction_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, employee_id, transaction_id FROM finance.customers WHERE birth_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by employee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, employee_id, transaction_id FROM finance.customers WHERE birth_date >= CURRENT_DATE - INTERVAL '30 days' ORDER BY employee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "What are the address, employee_id, birth_date of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT address, employee_id, birth_date FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with transaction_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT address, employee_id, birth_date FROM finance.customers ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Tally up customers by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.customers GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of customers in each address category.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM finance.customers GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY website DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY website DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE birth_date BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get max of employee_id by created_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(employee_id) AS max_employee_id FROM finance.customers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List birth_date, created_at, customer_id, card_type for each customer along with their transaction information.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.customer_id, transactions.card_type FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Order the output by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.customer_id, transactions.card_type FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.order_id ORDER BY employee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n account_id character varying(64) -- identifier for account,\n currency character varying(64),\n customer_id varchar -- identifier for customer,\n card_type varchar\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n address char,\n website character varying(256),\n birth_date timestamp,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with birth_date in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY birth_date DESC;", "sql": null}, {"role": "user", "content": "What is the sum website for each address in customers?", "sql": null}, {"role": "assistant", "content": "SELECT address, SUM(website) AS sum_website FROM finance.customers GROUP BY address;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "List bio, last_active, updated_at, backorder for each course along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.updated_at, grades.backorder FROM education.courses JOIN education.grades ON courses.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Show me the count of courses grouped by address.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM education.courses GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the max person_id for each address in courses?", "sql": null}, {"role": "assistant", "content": "SELECT address, MAX(person_id) AS max_person_id FROM education.courses GROUP BY address;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get person_id, is_active, last_active from all courses.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, is_active, last_active FROM education.courses;", "sql": null}, {"role": "user", "content": "Get person_id, last_active, image_url, updated_at by joining courses with grades.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, is_active, last_active, grades.image_url, grades.updated_at FROM education.courses JOIN education.grades ON courses.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Group courses by is_active and show the count of last_active.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(last_active) AS count_last_active FROM education.courses GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me is_active, bio, person_id for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, bio, person_id FROM education.courses;", "sql": null}, {"role": "user", "content": "List address, person_id, category, stock_level for each course along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, bio, person_id, grades.category, grades.stock_level FROM education.courses JOIN education.grades ON courses.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Group courses by person_id and show the sum of last_active.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, SUM(last_active) AS sum_last_active FROM education.courses GROUP BY person_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me bio, person_id, last_active for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT bio, person_id, last_active FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match grade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT bio, person_id, last_active FROM education.courses WHERE grade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT bio, person_id, last_active FROM education.courses WHERE grade_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Order the output by grade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE is_active = TRUE ORDER BY grade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "What are the is_active, address, person_id of each course?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, address, person_id FROM education.courses;", "sql": null}, {"role": "user", "content": "Can you order these by grade_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, address, person_id FROM education.courses ORDER BY grade_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by bio descending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, address, person_id FROM education.courses ORDER BY bio DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List address, last_active, grade_id from courses.", "sql": null}, {"role": "assistant", "content": "SELECT address, last_active, grade_id FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match person_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT address, last_active, grade_id FROM education.courses WHERE person_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT address, last_active, grade_id FROM education.courses WHERE person_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me grade_id, last_active, bio for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, last_active, bio FROM education.courses;", "sql": null}, {"role": "user", "content": "Get address, last_active, created_at, image_url by joining courses with grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, last_active, bio, grades.created_at, grades.image_url FROM education.courses JOIN education.grades ON courses.grade_id = grades.id;", "sql": null}, {"role": "user", "content": "Tally up courses by last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM education.courses GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n backorder character varying(64),\n category text NOT NULL,\n image_url character varying(256) NOT NULL,\n stock_level character varying(128)\n)\n\nCREATE TABLE education.courses (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n bio char,\n is_active bit NOT NULL,\n address character varying(128),\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY last_active DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me published_at, created_at, author_id for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, author_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, author_id FROM e-commerce.reviews WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of body by author_id from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, AVERAGE(body) AS average_body FROM e-commerce.reviews GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by format descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Order the output by format ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY format ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "List format, author_id, created_at from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, created_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List format, shippin_id, reply_to_id, keywords for each review along with their shipping information.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, created_at, shipping.reply_to_id, shipping.keywords FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.message_id;", "sql": null}, {"role": "user", "content": "Count the number of reviews in each author_id category.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "List format, author_id, created_at from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, created_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, created_at FROM e-commerce.reviews WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up reviews by shippin_id.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY shippin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "List published_at, author_id, shippin_id from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, shippin_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have shippin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, shippin_id FROM e-commerce.reviews WHERE shippin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, shippin_id FROM e-commerce.reviews WHERE shippin_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List format, author_id, format, reply_to_id for each review along with their shipping information.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.format, shipping.reply_to_id FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of reviews across different body values.", "sql": null}, {"role": "assistant", "content": "SELECT body, COUNT(*) AS count FROM e-commerce.reviews GROUP BY body ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with author_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-12-01' ORDER BY author_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate max of body for each shippin_id in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, MAX(body) AS max_body FROM e-commerce.reviews GROUP BY shippin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n author_id char,\n body character varying(128),\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.message_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(message_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(64),\n keywords char,\n format character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me created_at, format, body for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, format, body FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, format, body FROM e-commerce.reviews WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, format, body FROM e-commerce.reviews WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n currency character varying(256),\n media_url character varying(256) NOT NULL,\n manufacturer char NOT NULL,\n backorder text NOT NULL,\n rating varchar NOT NULL,\n subcategory varchar,\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n nationality character varying(128),\n membership_level char,\n full_name character varying(64) NOT NULL,\n language text,\n is_active bit -- indicates if active is true,\n salt character varying(64)\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n popularity_score char,\n video_url character varying(64),\n category char,\n tax_rate char,\n title varchar,\n stock_level char,\n cost bigint NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n shippin_id text -- reference to shipping.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode),\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n barcode text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n image_url character varying(128),\n brand varchar,\n featured_rank varchar NOT NULL,\n reserved char\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with subcategory in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY subcategory DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY subcategory DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n currency character varying(256),\n media_url character varying(256) NOT NULL,\n manufacturer char NOT NULL,\n backorder text NOT NULL,\n rating varchar NOT NULL,\n subcategory varchar,\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n nationality character varying(128),\n membership_level char,\n full_name character varying(64) NOT NULL,\n language text,\n is_active bit -- indicates if active is true,\n salt character varying(64)\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n popularity_score char,\n video_url character varying(64),\n category char,\n tax_rate char,\n title varchar,\n stock_level char,\n cost bigint NOT NULL,\n inventor_id text NOT NULL -- reference to inventory.barcode,\n shippin_id text -- reference to shipping.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode),\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.shipping (\n barcode text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n image_url character varying(128),\n brand varchar,\n featured_rank varchar NOT NULL,\n reserved char\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of inventory grouped by backorder.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM e-commerce.inventory GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get min of account_status by account_status from customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, MIN(account_status) AS min_account_status FROM finance.customers GROUP BY account_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by customer_id for customers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(created_at) AS max_created_at FROM finance.customers GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by address_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY address_id DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY address_id DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, created_at, capacity for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, created_at, capacity FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by last_inspected ascending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, created_at, capacity FROM finance.loans ORDER BY last_inspected ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, created_at, capacity FROM finance.loans ORDER BY last_inspected ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me zip_code, customer_id, account_status for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, customer_id, account_status FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, customer_id, account_status FROM finance.customers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with account_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, customer_id, account_status FROM finance.customers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY account_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE customer_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Get created_at, customer_id, zip_code from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, zip_code FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, zip_code FROM finance.customers ORDER BY account_status ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different account_status values.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(*) AS count FROM finance.customers GROUP BY account_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "List created_at, customer_id, zip_code from customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, zip_code FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, zip_code FROM finance.customers WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, zip_code FROM finance.customers WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans that have capacity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE capacity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE capacity LIKE 'A%' ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n street character varying(256) NOT NULL,\n geo_point character varying(128),\n capacity character varying(64),\n country character varying(64),\n operating_hours varchar\n)\n\nCREATE TABLE finance.customers (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n zip_code character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers that have customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of created_at for each zip_code in customers.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, MAX(created_at) AS max_created_at FROM finance.customers GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Show me operating_hours, event_id, capacity for all followers.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, event_id, capacity FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, event_id, capacity FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, event_id, capacity FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "List event_id, updated_at, address_line1 from followers.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, address_line1 FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where address_line1 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, address_line1 FROM socialmedia.followers WHERE address_line1 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by location_lon descending.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, address_line1 FROM socialmedia.followers WHERE address_line1 LIKE 'A%' ORDER BY location_lon DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with event_id > 90.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE event_id > 90;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE event_id > 90 LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve location_lon, updated_at, event_id for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, event_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, event_id FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with operating_hours in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, updated_at, event_id FROM socialmedia.followers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY operating_hours DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Display all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY discount DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Get address_line1, location_lon, updated_at from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, location_lon, updated_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, location_lon, updated_at FROM socialmedia.followers WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of followers in each capacity category.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM socialmedia.followers GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Show me tax_rate, updated_at, item_id for all likes.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, item_id FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, item_id FROM socialmedia.likes WHERE item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, item_id FROM socialmedia.likes WHERE item_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List location_lon, capacity, quantity, reserved for each follower along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.quantity, events.reserved FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.product_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.quantity, events.reserved FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.product_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, location_lon, operating_hours from followers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_lon, operating_hours FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match event_id > 78.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_lon, operating_hours FROM socialmedia.followers WHERE event_id > 78;", "sql": null}, {"role": "user", "content": "Order the output by capacity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_lon, operating_hours FROM socialmedia.followers WHERE event_id > 78 ORDER BY capacity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n product_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n reserved character varying(256),\n price decimal,\n quantity varchar,\n title character varying(256)\n)\n\nCREATE TABLE socialmedia.likes (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n discount numeric(38,14),\n tax_rate character varying(256),\n featured_rank char NOT NULL,\n follower_id text NOT NULL -- reference to followers.venue_id,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (follower_id) REFERENCES followers(venue_id),\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)\n\nCREATE TABLE socialmedia.followers (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n capacity character varying(256),\n address_line1 text NOT NULL,\n location_lon text,\n operating_hours character varying(128) NOT NULL,\n event_id integer -- reference to events.product_id,\n FOREIGN KEY (event_id) REFERENCES events(product_id)\n)", "conversations": [{"role": "user", "content": "What are the event_id, updated_at, featured_rank of each like?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, featured_rank FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve likes where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, featured_rank FROM socialmedia.likes WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, updated_at, featured_rank FROM socialmedia.likes WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "What are the backorder, created_at, teacher_id of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, teacher_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Order the output by rating descending.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, teacher_id FROM education.grades ORDER BY rating DESC;", "sql": null}, {"role": "user", "content": "Group grades by featured_rank and show the count of backorder.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(backorder) AS count_backorder FROM education.grades GROUP BY featured_rank;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "What are the backorder, expires_at, teacher_id of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, expires_at, teacher_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, expires_at, teacher_id FROM education.grades WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up grades by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM education.grades GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with expires_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show me min of featured_rank grouped by backorder for grades.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, MIN(featured_rank) AS min_featured_rank FROM education.grades GROUP BY backorder;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve backorder, created_at, description, timezone showing the relationship between grades and teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.description, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id;", "sql": null}, {"role": "user", "content": "Get min of created_at by expires_at from grades.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MIN(created_at) AS min_created_at FROM education.grades GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "What are the expires_at, backorder, rating of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, backorder, rating FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades that have backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, backorder, rating FROM education.grades WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, backorder, rating FROM education.grades WHERE backorder LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve rating, expires_at, description, timezone showing the relationship between grades and teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.description, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.description, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "What are the teacher_id, rating, featured_rank of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, rating, featured_rank FROM education.grades;", "sql": null}, {"role": "user", "content": "Get rating, featured_rank, description, timezone by joining grades with teachers.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, rating, featured_rank, teachers.description, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id;", "sql": null}, {"role": "user", "content": "Tally up grades by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.grades GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with featured_rank in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY featured_rank ASC;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Order the output by backorder descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY backorder DESC;", "sql": null}, {"role": "user", "content": "Show me sum of rating grouped by teacher_id for grades.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, SUM(rating) AS sum_rating FROM education.grades GROUP BY teacher_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n rating char,\n backorder character varying(64),\n featured_rank character varying(128),\n teacher_id text -- reference to teachers.venue_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(venue_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n timezone char,\n description varchar\n)", "conversations": [{"role": "user", "content": "List backorder, created_at, featured_rank from grades.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, featured_rank FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me created_at, expires_at, last_inspected, timezone from grades and their related teachers.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, featured_rank, teachers.last_inspected, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id;", "sql": null}, {"role": "user", "content": "Can you order these by featured_rank descending?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, created_at, featured_rank, teachers.last_inspected, teachers.timezone FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.venue_id ORDER BY featured_rank DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n vendor_id character varying(256) -- identifier for vendor,\n currency character varying(256) NOT NULL,\n payee_id char -- identifier for payee,\n verification_status character varying(256) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)\n\nCREATE TABLE transportation.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level character varying(64) NOT NULL,\n account_status char,\n last_login timestamp without time zone,\n state character varying(64) NOT NULL,\n website character varying(128),\n country character varying(256),\n username varchar\n)\n\nCREATE TABLE transportation.comments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n categories text,\n message varchar,\n keywords character varying(128) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n member_id text -- reference to members.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id),\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE transportation.bookings (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n processed_at timestamp,\n card_type varchar NOT NULL,\n tax numeric(38,14),\n payment_method varchar,\n status text,\n account_id text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.comments;", "sql": null}, {"role": "user", "content": "Show me comments with member_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.comments WHERE member_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of message by message from comments.", "sql": null}, {"role": "assistant", "content": "SELECT message, AVERAGE(message) AS average_message FROM transportation.comments GROUP BY message;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n vendor_id character varying(256) -- identifier for vendor,\n currency character varying(256) NOT NULL,\n payee_id char -- identifier for payee,\n verification_status character varying(256) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)\n\nCREATE TABLE transportation.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level character varying(64) NOT NULL,\n account_status char,\n last_login timestamp without time zone,\n state character varying(64) NOT NULL,\n website character varying(128),\n country character varying(256),\n username varchar\n)\n\nCREATE TABLE transportation.comments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n categories text,\n message varchar,\n keywords character varying(128) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n member_id text -- reference to members.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id),\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE transportation.bookings (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n processed_at timestamp,\n card_type varchar NOT NULL,\n tax numeric(38,14),\n payment_method varchar,\n status text,\n account_id text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing;", "sql": null}, {"role": "user", "content": "List billing that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing WHERE currency LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n vendor_id character varying(256) -- identifier for vendor,\n currency character varying(256) NOT NULL,\n payee_id char -- identifier for payee,\n verification_status character varying(256) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)\n\nCREATE TABLE transportation.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level character varying(64) NOT NULL,\n account_status char,\n last_login timestamp without time zone,\n state character varying(64) NOT NULL,\n website character varying(128),\n country character varying(256),\n username varchar\n)\n\nCREATE TABLE transportation.comments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n categories text,\n message varchar,\n keywords character varying(128) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n member_id text -- reference to members.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id),\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE transportation.bookings (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n processed_at timestamp,\n card_type varchar NOT NULL,\n tax numeric(38,14),\n payment_method varchar,\n status text,\n account_id text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing;", "sql": null}, {"role": "user", "content": "List billing that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.billing WHERE currency LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.billing (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n vendor_id character varying(256) -- identifier for vendor,\n currency character varying(256) NOT NULL,\n payee_id char -- identifier for payee,\n verification_status character varying(256) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id)\n)\n\nCREATE TABLE transportation.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level character varying(64) NOT NULL,\n account_status char,\n last_login timestamp without time zone,\n state character varying(64) NOT NULL,\n website character varying(128),\n country character varying(256),\n username varchar\n)\n\nCREATE TABLE transportation.comments (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n categories text,\n message varchar,\n keywords character varying(128) NOT NULL,\n booking_id integer NOT NULL -- reference to bookings.payment_id,\n member_id text -- reference to members.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(payment_id),\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE transportation.bookings (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n processed_at timestamp,\n card_type varchar NOT NULL,\n tax numeric(38,14),\n payment_method varchar,\n status text,\n account_id text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where booking_id > 30.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.comments WHERE booking_id > 30;", "sql": null}, {"role": "user", "content": "Group comments by categories and show the count of member_id.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(member_id) AS count_member_id FROM transportation.comments GROUP BY categories;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n image_url character varying(256) NOT NULL,\n backorder varchar NOT NULL,\n stock_level character varying(256),\n rating text\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n reply_to_id varchar,\n image_url character varying(64),\n author_id character varying(256) -- identifier for author,\n keywords varchar,\n body character varying(64),\n attachment_url text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id text -- reference to medical_records.sku,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(sku)\n)\n\nCREATE TABLE healthcare.appointments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at timestamp,\n thumbnail varchar,\n score character varying(64) NOT NULL,\n content text NOT NULL,\n reply_to_id character varying(128) -- identifier for reply_to,\n shares character varying(256),\n media_url char NOT NULL,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n gender character varying(128),\n country character varying(256) NOT NULL,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments where id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE id LIKE 'A%' ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve created_at, author_id, payer_id, notes showing the relationship between reviews and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.payer_id, shipping.notes FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.account_id;", "sql": null}, {"role": "user", "content": "Can you order these by author_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.payer_id, shipping.notes FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.account_id ORDER BY author_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the shippin_id, rating, categories of each review?", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, rating, categories FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where categories LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, rating, categories FROM e-commerce.reviews WHERE categories LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of reviews in each categories category.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM e-commerce.reviews GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get rating, author_id, updated_at from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT rating, author_id, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT rating, author_id, updated_at FROM e-commerce.reviews WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, author_id, updated_at FROM e-commerce.reviews WHERE author_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Order the output by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY media_url DESC;", "sql": null}, {"role": "user", "content": "Count the number of reviews in each shippin_id category.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY shippin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of reviews in each categories category.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM e-commerce.reviews GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE rating LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get updated_at, author_id, created_at from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, created_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, created_at FROM e-commerce.reviews WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, created_at FROM e-commerce.reviews WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get all reviews created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up reviews by shippin_id.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY shippin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n shares text NOT NULL,\n author_id char -- identifier for author,\n media_url character varying(256),\n categories char,\n rating char,\n shippin_id text -- reference to shipping.account_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(account_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n account_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n notes character varying(64),\n payer_id varchar NOT NULL -- identifier for payer,\n reference_number char NOT NULL\n)", "conversations": [{"role": "user", "content": "List author_id, media_url, categories from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, media_url, categories FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, media_url, categories FROM e-commerce.reviews WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of reviews in each shares category.", "sql": null}, {"role": "assistant", "content": "SELECT shares, COUNT(*) AS count FROM e-commerce.reviews GROUP BY shares ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What description, subject, title, updated_at do we have for messages and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.title, events.updated_at FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.title, events.updated_at FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, updated_at, rating of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, rating FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, rating FROM socialmedia.comments WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of rating by rating from comments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, AVERAGE(rating) AS average_rating FROM socialmedia.comments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "What image_url, event_id, updated_at, rating do we have for comments and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.rating FROM socialmedia.comments JOIN socialmedia.events ON comments.event_id = events.sku;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.rating FROM socialmedia.comments JOIN socialmedia.events ON comments.event_id = events.sku ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail_url, updated_at, comment_id for every event.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, comment_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, comment_id FROM socialmedia.events WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get sum of title by thumbnail_url from events.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, SUM(title) AS sum_title FROM socialmedia.events GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get title, thumbnail_url, updated_at from all events.", "sql": null}, {"role": "assistant", "content": "SELECT title, thumbnail_url, updated_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Order the output by thumbnail_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT title, thumbnail_url, updated_at FROM socialmedia.events ORDER BY thumbnail_url DESC;", "sql": null}, {"role": "user", "content": "Sort the results by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT title, thumbnail_url, updated_at FROM socialmedia.events ORDER BY comment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of comments across different image_url values.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM socialmedia.comments GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with image_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY image_url ASC;", "sql": null}, {"role": "user", "content": "Show me the count of comments grouped by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM socialmedia.comments GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "What are the views, message_id, event_id of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT views, message_id, event_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Order the output by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT views, message_id, event_id FROM socialmedia.comments ORDER BY views DESC;", "sql": null}, {"role": "user", "content": "Order the output by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT views, message_id, event_id FROM socialmedia.comments ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "Get user_id, format, event_id from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, format, event_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, format, event_id FROM socialmedia.messages ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Calculate max of user_id for each description in messages.", "sql": null}, {"role": "assistant", "content": "SELECT description, MAX(user_id) AS max_user_id FROM socialmedia.messages GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n thumbnail_url character varying(64),\n rating character varying(128),\n title character varying(128),\n comment_id text NOT NULL -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n user_id char -- identifier for user,\n subject character varying(256) NOT NULL,\n description char,\n attachment_url char,\n message char,\n format varchar,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating char NOT NULL,\n image_url varchar NOT NULL,\n views varchar,\n event_id text -- reference to events.sku,\n message_id text NOT NULL -- reference to messages.message_id,\n FOREIGN KEY (event_id) REFERENCES events(sku),\n FOREIGN KEY (message_id) REFERENCES messages(message_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, rating, thumbnail_url of each event?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, rating, thumbnail_url FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events where title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, rating, thumbnail_url FROM socialmedia.events WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, rating, thumbnail_url FROM socialmedia.events WHERE title LIKE 'A%' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get all prescriptions modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE traded_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate min of currency for each currency in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, MIN(currency) AS min_currency FROM healthcare.prescriptions GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions with delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE delivery_status LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by due_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE payment_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY due_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Order the output by billin_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY billin_id ASC;", "sql": null}, {"role": "user", "content": "Group prescriptions by billin_id and show the max of status.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, MAX(status) AS max_status FROM healthcare.prescriptions GROUP BY billin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by msrp descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY msrp DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY media_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match medical_record_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE medical_record_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE medical_record_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get sum of media_url by updated_at from billing.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(media_url) AS sum_media_url FROM healthcare.billing GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category character varying(64),\n reserved character varying(64) NOT NULL,\n quantity character varying(256) NOT NULL,\n media_url varchar,\n msrp char,\n name text NOT NULL,\n medical_record_id text NOT NULL -- reference to medical_records.transaction_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n traded_at timestamp,\n delivery_status character varying(256),\n payment_method character varying(64),\n status varchar,\n currency text,\n exchange_rate character varying(256),\n approval_status character varying(256),\n billin_id integer NOT NULL -- reference to billing.product_id,\n FOREIGN KEY (billin_id) REFERENCES billing(product_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id varchar -- identifier for payer,\n verification_status character varying(256),\n balance decimal,\n reference_number character varying(64),\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Group billing by updated_at and show the sum of reserved.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(reserved) AS sum_reserved FROM healthcare.billing GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate max of metadat_id for each cancelled_at in orders.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, MAX(metadat_id) AS max_metadat_id FROM tradingplatform.orders GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by payment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by payment_id.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get metadat_id, currency, author_id, edited_at by joining trades with metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.author_id, metadata.edited_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.post_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.author_id, metadata.edited_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.post_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What cancelled_at, account_id, format, author_id do we have for orders and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.format, metadata.author_id FROM tradingplatform.orders JOIN tradingplatform.metadata ON orders.metadat_id = metadata.post_id;", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by seller_id.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different seller_id values.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Sort the results by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY subtotal DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY subtotal DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve cancelled_at, payment_id, account_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_id, account_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What seller_id, account_id, published_at, edited_at do we have for orders and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_id, account_id, metadata.published_at, metadata.edited_at FROM tradingplatform.orders JOIN tradingplatform.metadata ON orders.metadat_id = metadata.post_id;", "sql": null}, {"role": "user", "content": "Tally up orders by cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "What delivery_status, card_type, media_url, edited_at do we have for trades and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.media_url, metadata.edited_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.post_id;", "sql": null}, {"role": "user", "content": "Group trades by currency and show the max of currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, MAX(currency) AS max_currency FROM tradingplatform.trades GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n currency varchar,\n delivery_status character varying(256),\n price bigint,\n quantity text,\n card_type text NOT NULL,\n subtotal integer NOT NULL,\n metadat_id text -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n author_id character varying(64) -- identifier for author,\n format char,\n media_url character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n seller_id text,\n account_id character varying(128),\n metadat_id text NOT NULL -- reference to metadata.post_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve currency, card_type, delivery_status for every trade.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, delivery_status FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show me currency, updated_at, published_at, edited_at from trades and their related metadata.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, delivery_status, metadata.published_at, metadata.edited_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.post_id;", "sql": null}, {"role": "user", "content": "Arrange the results with subtotal in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, delivery_status, metadata.published_at, metadata.edited_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.post_id ORDER BY subtotal DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show the results sorted by completed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY completed_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where due_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve completed_at, approval_status, buyer_id for every trade.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, approval_status, buyer_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, approval_status, buyer_id FROM tradingplatform.trades WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the average payment_method for each payment_method in trades?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(payment_method) AS average_payment_method FROM tradingplatform.trades GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Sort the results by is_verified ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY is_verified ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List wallet_id, buyer_id, trade_id, created_at for each trade along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.trade_id, users.created_at FROM tradingplatform.trades JOIN tradingplatform.users ON trades.user_id = users.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of trades in each payment_method category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM tradingplatform.trades GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Order the output by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "How many trades are there per payment_method?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM tradingplatform.trades GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by completed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE payment_method LIKE 'A%' ORDER BY completed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n membership_level character varying(64) NOT NULL,\n is_verified bit NOT NULL,\n last_name text,\n username char,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at date,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n approval_status character varying(64),\n user_id text -- reference to users.employee_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n buyer_id char -- identifier for buyer,\n approval_status text,\n payment_method character varying(64),\n user_id text NOT NULL -- reference to users.employee_id,\n wallet_id integer -- reference to wallets.invoice_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have is_verified = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE is_verified = TRUE;", "sql": null}, {"role": "user", "content": "Tally up users by is_verified.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, COUNT(*) AS count FROM tradingplatform.users GROUP BY is_verified ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "List user_id, traded_at, transaction_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, transaction_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, transaction_id FROM tradingplatform.orders WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the max approval_status for each quantity in orders?", "sql": null}, {"role": "assistant", "content": "SELECT quantity, MAX(approval_status) AS max_approval_status FROM tradingplatform.orders GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Can you order these by traded_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY traded_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve quantity, transaction_id, traded_at for every order.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, transaction_id, traded_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What processed_at, traded_at, updated_at, latitude do we have for orders and their associated notifications?", "sql": null}, {"role": "assistant", "content": "SELECT quantity, transaction_id, traded_at, notifications.updated_at, notifications.latitude FROM tradingplatform.orders JOIN tradingplatform.notifications ON orders.notification_id = notifications.store_id;", "sql": null}, {"role": "user", "content": "Show me average of processed_at grouped by processed_at for orders.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, AVERAGE(processed_at) AS average_processed_at FROM tradingplatform.orders GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get orders that match notification_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE notification_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE notification_id LIKE 'A%' ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Get transaction_id, processed_at, user_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, processed_at, user_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, processed_at, user_id FROM tradingplatform.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate min of processed_at for each approval_status in orders.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MIN(processed_at) AS min_processed_at FROM tradingplatform.orders GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "List approval_status, quantity, traded_at from orders.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, quantity, traded_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, quantity, traded_at FROM tradingplatform.orders ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Count the number of orders in each user_id category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with notification_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY notification_id ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY notification_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Show me approval_status, processed_at, notification_id for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, notification_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, notification_id FROM tradingplatform.orders ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, processed_at, notification_id FROM tradingplatform.orders ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up orders by notification_id.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY notification_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n store_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n operating_hours text,\n latitude char,\n type character varying(256)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n quantity text NOT NULL,\n approval_status text,\n user_id character varying(64) NOT NULL,\n notification_id text -- reference to notifications.store_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(store_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Can you order these by user_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get sum of created_at by currency from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT currency, SUM(created_at) AS sum_created_at FROM finance.accounts GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up loans by bio.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM finance.loans GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve bio, created_at, is_active for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT bio, created_at, is_active FROM finance.loans;", "sql": null}, {"role": "user", "content": "Order the output by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT bio, created_at, is_active FROM finance.loans ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT bio, created_at, is_active FROM finance.loans ORDER BY account_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List loan_id, status, created_at from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, status, created_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, status, created_at FROM finance.accounts WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with loan_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, status, created_at FROM finance.accounts WHERE updated_at > '2023-01-01' ORDER BY loan_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List created_at, notes, loan_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, notes, loan_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get currency, loan_id, account_id, joined_at by joining accounts with loans.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, notes, loan_id, loans.account_id, loans.joined_at FROM finance.accounts JOIN finance.loans ON accounts.loan_id = loans.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of accounts in each currency category.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM finance.accounts GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List is_active, created_at, loan_id, currency for each loan along with their account information.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.loan_id, accounts.currency FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Can you order these by is_active descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.loan_id, accounts.currency FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.id ORDER BY is_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "What are the joined_at, language, account_id of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, account_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by account_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, account_id FROM finance.loans ORDER BY account_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, account_id FROM finance.loans ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get is_active, account_id, bio from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, account_id, bio FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, account_id, bio FROM finance.loans WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, account_id, bio FROM finance.loans WHERE created_at > '2023-01-01' ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List language, created_at, is_active from loans.", "sql": null}, {"role": "assistant", "content": "SELECT language, created_at, is_active FROM finance.loans;", "sql": null}, {"role": "user", "content": "Arrange the results with bio in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT language, created_at, is_active FROM finance.loans ORDER BY bio DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.loans GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n status varchar,\n notes char,\n currency char NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp,\n is_active bit NOT NULL,\n language character varying(128),\n bio text NOT NULL,\n account_id text NOT NULL -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List status, updated_at, created_at from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, created_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me loan_id, created_at, bio, account_id from accounts and their related loans.", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, created_at, loans.bio, loans.account_id FROM finance.accounts JOIN finance.loans ON accounts.loan_id = loans.employee_id;", "sql": null}, {"role": "user", "content": "Arrange the results with notes in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, created_at, loans.bio, loans.account_id FROM finance.accounts JOIN finance.loans ON accounts.loan_id = loans.employee_id ORDER BY notes ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by address ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY address ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different api_key values.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM socialmedia.users GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve zip_code, last_active, created_at, parent_id showing the relationship between users and messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.created_at, messages.parent_id FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id;", "sql": null}, {"role": "user", "content": "Tally up users by address.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM socialmedia.users GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many users are there per api_key?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM socialmedia.users GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Get last_active, api_key, address from all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, api_key, address FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by message_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, api_key, address FROM socialmedia.users ORDER BY message_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different message_id values.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.users GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Get last_active, zip_code, message_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, message_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List api_key, message_id, reply_to_id, title for each user along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, message_id, messages.reply_to_id, messages.title FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, message_id, messages.reply_to_id, messages.title FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve zip_code, last_active, api_key for every user.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, last_active, api_key FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List message_id, zip_code, reply_to_id, parent_id for each user along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, last_active, api_key, messages.reply_to_id, messages.parent_id FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, last_active, api_key, messages.reply_to_id, messages.parent_id FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me api_key, zip_code, last_active for all users.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, last_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, last_active FROM socialmedia.users WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by address ascending.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, last_active FROM socialmedia.users WHERE zip_code LIKE 'A%' ORDER BY address ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the api_key, zip_code, address of each user?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, address FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me address, message_id, title, reply_to_id from users and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, address, messages.title, messages.reply_to_id FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, zip_code, address, messages.title, messages.reply_to_id FROM socialmedia.users JOIN socialmedia.messages ON users.message_id = messages.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n address text,\n zip_code character varying(128),\n api_key text,\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)\n\nCREATE TABLE socialmedia.groups (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n balance integer NOT NULL,\n amount numeric NOT NULL,\n approval_status character varying(64),\n user_id varchar -- identifier for user,\n status character varying(64) NOT NULL,\n invoice_number character varying(64)\n)\n\nCREATE TABLE socialmedia.messages (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n reply_to_id char,\n parent_id char NOT NULL -- identifier for parent,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by api_key descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY api_key DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve operating_hours, type, prescription_id for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, type, prescription_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get last_inspected, created_at, edited_at, reply_to_id by joining medical_records with prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, type, prescription_id, prescriptions.edited_at, prescriptions.reply_to_id FROM healthcare.medical_records JOIN healthcare.prescriptions ON medical_records.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Show me the count of medical_records grouped by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM healthcare.medical_records GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Arrange the results with reply_to_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY reply_to_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of prescriptions in each thumbnail category.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY thumbnail ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get medical_records that match prescription_id > 11.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE prescription_id > 11;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE prescription_id > 11 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve visibility, tags, medical_record_id for every prescription.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, tags, medical_record_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get reply_to_id, tags, zip_code, prescription_id by joining prescriptions with medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, tags, medical_record_id, medical_records.zip_code, medical_records.prescription_id FROM healthcare.prescriptions JOIN healthcare.medical_records ON prescriptions.medical_record_id = medical_records.location_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, tags, medical_record_id, medical_records.zip_code, medical_records.prescription_id FROM healthcare.prescriptions JOIN healthcare.medical_records ON prescriptions.medical_record_id = medical_records.location_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Get created_at, last_inspected, zip_code from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_inspected, zip_code FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List zip_code, operating_hours, categories, medical_record_id for each medical_record along with their prescription information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_inspected, zip_code, prescriptions.categories, prescriptions.medical_record_id FROM healthcare.medical_records JOIN healthcare.prescriptions ON medical_records.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Calculate sum of created_at for each created_at in medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(created_at) AS sum_created_at FROM healthcare.medical_records GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Get operating_hours, last_inspected, zip_code from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, last_inspected, zip_code FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by operating_hours ascending?", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, last_inspected, zip_code FROM healthcare.medical_records ORDER BY operating_hours ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of medical_records across different type values.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM healthcare.medical_records GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "List created_at, prescription_id, last_inspected from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, prescription_id, last_inspected FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "What operating_hours, type, medical_record_id, tags do we have for medical_records and their associated prescriptions?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, prescription_id, last_inspected, prescriptions.medical_record_id, prescriptions.tags FROM healthcare.medical_records JOIN healthcare.prescriptions ON medical_records.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Tally up medical_records by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by shares ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY shares ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n location_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n zip_code varchar,\n type text,\n operating_hours character varying(64) NOT NULL,\n prescription_id integer NOT NULL -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n visibility character varying(256),\n reply_to_id character varying(128) NOT NULL,\n categories char NOT NULL,\n thumbnail char,\n user_id character varying(256) -- identifier for user,\n tags text NOT NULL,\n shares char,\n medical_record_id text -- reference to medical_records.location_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(location_id)\n)", "conversations": [{"role": "user", "content": "List zip_code, created_at, prescription_id from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, prescription_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, prescription_id FROM healthcare.medical_records WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, created_at, prescription_id FROM healthcare.medical_records WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve location_lon, category, last_inspected for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, last_inspected FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get categories that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, last_inspected FROM e-commerce.categories WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group categories by review_id and show the average of last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, AVERAGE(last_inspected) AS average_last_inspected FROM e-commerce.categories GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, categorie_id, media_url for every review.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, media_url FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with message in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, media_url FROM e-commerce.reviews ORDER BY message ASC;", "sql": null}, {"role": "user", "content": "Sort the results by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, media_url FROM e-commerce.reviews ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List last_inspected, category, operating_hours from categories.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, category, operating_hours FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve description, review_id, keywords, format showing the relationship between categories and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, category, operating_hours, reviews.keywords, reviews.format FROM e-commerce.categories JOIN e-commerce.reviews ON categories.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "How many categories are there per category?", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM e-commerce.categories GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me category, description, last_inspected for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT category, description, last_inspected FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve categories where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT category, description, last_inspected FROM e-commerce.categories WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with review_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, description, last_inspected FROM e-commerce.categories WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY review_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match thumbnail LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE thumbnail LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE thumbnail LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, keywords, thumbnail of each review?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, keywords, thumbnail FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, keywords, thumbnail FROM e-commerce.reviews WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many reviews are there per media_url?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM e-commerce.reviews GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me media_url, parent_id, published_at for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, parent_id, published_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, parent_id, published_at FROM e-commerce.reviews WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with message in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, parent_id, published_at FROM e-commerce.reviews WHERE published_at > '2023-12-01' ORDER BY message ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me media_url, categorie_id, keywords for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, categorie_id, keywords FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, categorie_id, keywords FROM e-commerce.reviews WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of parent_id by thumbnail from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, SUM(parent_id) AS sum_parent_id FROM e-commerce.reviews GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where keywords LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE keywords LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by categorie_id.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY categorie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at date,\n format character varying(64) NOT NULL,\n media_url character varying(128) NOT NULL,\n thumbnail character varying(64),\n parent_id character varying(128) NOT NULL -- identifier for parent,\n message character varying(256),\n keywords varchar,\n categorie_id integer NOT NULL -- reference to categories.store_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(store_id)\n)\n\nCREATE TABLE e-commerce.categories (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n description character varying(256) NOT NULL,\n location_lon char,\n category character varying(64) NOT NULL,\n operating_hours character varying(256),\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Sort the results by message descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY message DESC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY message DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students;", "sql": null}, {"role": "user", "content": "Can you order these by person_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY person_id ASC;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY person_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students;", "sql": null}, {"role": "user", "content": "Show me students that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Order the output by timezone descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Get salt, first_name, person_id from all students.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, person_id FROM marketing.students;", "sql": null}, {"role": "user", "content": "Retrieve students where salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, person_id FROM marketing.students WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT salt, first_name, person_id FROM marketing.students WHERE salt LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List status, sale_id, good_id from students.", "sql": null}, {"role": "assistant", "content": "SELECT status, sale_id, good_id FROM marketing.students;", "sql": null}, {"role": "user", "content": "Retrieve students where timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, sale_id, good_id FROM marketing.students WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of city grouped by timezone for students.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MAX(city) AS max_city FROM marketing.students GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me published_at, expires_at, category for all goods.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, category FROM marketing.goods;", "sql": null}, {"role": "user", "content": "Show the results sorted by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, category FROM marketing.goods ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, category FROM marketing.goods ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve timezone, status, city for every student.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, status, city FROM marketing.students;", "sql": null}, {"role": "user", "content": "List good_id, salt, payment_status, card_type for each student along with their sale information.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, status, city, sales.payment_status, sales.card_type FROM marketing.students JOIN marketing.sales ON students.sale_id = sales.order_id;", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by person_id.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, COUNT(*) AS count FROM marketing.students GROUP BY person_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve city, good_id, person_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT city, good_id, person_id FROM marketing.students;", "sql": null}, {"role": "user", "content": "Find students where salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT city, good_id, person_id FROM marketing.students WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many students are there per phone?", "sql": null}, {"role": "assistant", "content": "SELECT phone, COUNT(*) AS count FROM marketing.students GROUP BY phone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List person_id, status, phone from students.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, status, phone FROM marketing.students;", "sql": null}, {"role": "user", "content": "List students that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT person_id, status, phone FROM marketing.students WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me min of salt grouped by status for students.", "sql": null}, {"role": "assistant", "content": "SELECT status, MIN(salt) AS min_salt FROM marketing.students GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods;", "sql": null}, {"role": "user", "content": "Show me goods that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of goods across different expires_at values.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM marketing.goods GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n category character varying(64) NOT NULL,\n backorder char,\n views varchar NOT NULL,\n sale_id integer -- reference to sales.order_id,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id)\n)\n\nCREATE TABLE marketing.students (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n salt text NOT NULL,\n phone character varying(64),\n city varchar NOT NULL,\n status text,\n timezone text,\n first_name text,\n sale_id integer NOT NULL -- reference to sales.order_id,\n good_id text NOT NULL -- reference to goods.barcode,\n FOREIGN KEY (sale_id) REFERENCES sales(order_id),\n FOREIGN KEY (good_id) REFERENCES goods(barcode)\n)\n\nCREATE TABLE marketing.facilities (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n description character varying(128),\n zip_code character varying(128),\n location_lat text NOT NULL,\n location_lon text\n)\n\nCREATE TABLE marketing.sales (\n order_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n payment_status character varying(256) NOT NULL,\n card_type text,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods;", "sql": null}, {"role": "user", "content": "Order the output by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods ORDER BY expires_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of goods across different backorder values.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM marketing.goods GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata where location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me max of location_lon grouped by category for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(location_lon) AS max_location_lon FROM tradingplatform.metadata GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get language, email, membership_level from all users.", "sql": null}, {"role": "assistant", "content": "SELECT language, email, membership_level FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users where last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT language, email, membership_level FROM tradingplatform.users WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by membership_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT language, email, membership_level FROM tradingplatform.users WHERE last_active > '2023-01-01' ORDER BY membership_level ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE timezone LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me category, wallet_id, wallet_id, last_active from metadata and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.wallet_id, users.last_active FROM tradingplatform.metadata JOIN tradingplatform.users ON metadata.user_id = users.id;", "sql": null}, {"role": "user", "content": "Get average of category by timezone from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, AVERAGE(category) AS average_category FROM tradingplatform.metadata GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me membership_level, wallet_id, email for all users.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, wallet_id, email FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, wallet_id, email FROM tradingplatform.users WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, wallet_id, email FROM tradingplatform.users WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "What are the email, language, wallet_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT email, language, wallet_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by wallet_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT email, language, wallet_id FROM tradingplatform.users ORDER BY wallet_id ASC;", "sql": null}, {"role": "user", "content": "Show me min of created_at grouped by language for users.", "sql": null}, {"role": "assistant", "content": "SELECT language, MIN(created_at) AS min_created_at FROM tradingplatform.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of users in each wallet_id category.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(*) AS count FROM tradingplatform.users GROUP BY wallet_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "What are the email, last_active, language of each user?", "sql": null}, {"role": "assistant", "content": "SELECT email, last_active, language FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT email, last_active, language FROM tradingplatform.users WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group users by language and show the count of language.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(language) AS count_language FROM tradingplatform.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "What are the language, last_active, token of each user?", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, token FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, token FROM tradingplatform.users WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, token FROM tradingplatform.users WHERE created_at > '2023-01-01' ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n coordinates varchar,\n parking_available text NOT NULL,\n location_lon character varying(256),\n category char,\n timezone char NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n payer_id varchar -- identifier for payer,\n user_id character varying(256),\n reconciliation_status character varying(128),\n category text,\n currency character varying(256)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active timestamp,\n email character varying(64),\n token text NOT NULL,\n language text,\n city character varying(256),\n membership_level text,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me email, language, token for all users.", "sql": null}, {"role": "assistant", "content": "SELECT email, language, token FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT email, language, token FROM tradingplatform.users WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with email in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT email, language, token FROM tradingplatform.users WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY email ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where appointment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE appointment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE appointment_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where appointment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE appointment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE appointment_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, buyer_id, discount for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, discount FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Order the output by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, discount FROM healthcare.departments ORDER BY amount DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, buyer_id, discount FROM healthcare.departments ORDER BY amount DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get min of buyer_id by buyer_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, MIN(buyer_id) AS min_buyer_id FROM healthcare.departments GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "How many billing are there per type?", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM healthcare.billing GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "What address_line1, department_id, appointment_id, discount do we have for billing and their associated departments?", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.appointment_id, departments.discount FROM healthcare.billing JOIN healthcare.departments ON billing.department_id = departments.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.appointment_id, departments.discount FROM healthcare.billing JOIN healthcare.departments ON billing.department_id = departments.invoice_id ORDER BY accessibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me appointment_id, updated_at, payment_status for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, updated_at, payment_status FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, updated_at, payment_status FROM healthcare.departments WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many departments are there per amount?", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM healthcare.departments GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility character varying(64),\n parking_available character varying(128) NOT NULL,\n address_line1 char NOT NULL,\n type char,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE healthcare.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n amount decimal NOT NULL,\n buyer_id character varying(128),\n payment_status character varying(128),\n card_type character varying(64) NOT NULL,\n discount integer,\n appointment_id text NOT NULL -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)\n\nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n credit varchar,\n category character varying(64),\n reference_number char NOT NULL,\n approval_status char NOT NULL,\n reconciliation_status character varying(256) NOT NULL,\n currency character varying(128),\n payer_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by department_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY department_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of billing grouped by type.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM healthcare.billing GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get payment_status, seller_id, reconciliation_status, trade_id by joining orders with wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.reconciliation_status, wallets.trade_id FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Show me count of updated_at grouped by subtotal for orders.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(updated_at) AS count_updated_at FROM tradingplatform.orders GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve description, trade_id, created_at for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT description, trade_id, created_at FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT description, trade_id, created_at FROM tradingplatform.wallets WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT description, trade_id, created_at FROM tradingplatform.wallets WHERE created_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY created_at ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by reconciliation_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY reconciliation_status DESC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY reconciliation_status DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE status LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get sum of trade_id by trade_id from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, SUM(trade_id) AS sum_trade_id FROM tradingplatform.wallets GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List price, currency, user_id from trades.", "sql": null}, {"role": "assistant", "content": "SELECT price, currency, user_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve trades where price > 37.", "sql": null}, {"role": "assistant", "content": "SELECT price, currency, user_id FROM tradingplatform.trades WHERE price > 37;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT price, currency, user_id FROM tradingplatform.trades WHERE price > 37 LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "What category, created_at, completed_at, user_id do we have for wallets and their associated trades?", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.completed_at, trades.user_id FROM tradingplatform.wallets JOIN tradingplatform.trades ON wallets.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Get the distribution of wallets across different description values.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Calculate min of quantity for each subtotal in orders.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, MIN(quantity) AS min_quantity FROM tradingplatform.orders GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description text,\n reconciliation_status character varying(128),\n category text,\n trade_id text NOT NULL -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n quantity text,\n seller_id character varying(128),\n subtotal numeric(38,14),\n payment_status char NOT NULL,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(128),\n currency text,\n customer_id text NOT NULL,\n user_id char,\n price decimal,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve description, reconciliation_status, created_at for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT description, reconciliation_status, created_at FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve trade_id, category, status, user_id showing the relationship between wallets and trades.", "sql": null}, {"role": "assistant", "content": "SELECT description, reconciliation_status, created_at, trades.status, trades.user_id FROM tradingplatform.wallets JOIN tradingplatform.trades ON wallets.trade_id = trades.invoice_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT description, reconciliation_status, created_at, trades.status, trades.user_id FROM tradingplatform.wallets JOIN tradingplatform.trades ON wallets.trade_id = trades.invoice_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, user_id, image_url of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, image_url FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers with body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, image_url FROM education.teachers WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of image_url for each user_id in teachers.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(image_url) AS sum_image_url FROM education.teachers GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Show me image_url, updated_at, body for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, updated_at, body FROM education.teachers;", "sql": null}, {"role": "user", "content": "List image_url, description, status, avatar for each teacher along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, updated_at, body, students.status, students.avatar FROM education.teachers JOIN education.students ON teachers.student_id = students.id;", "sql": null}, {"role": "user", "content": "Arrange the results with body in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, updated_at, body, students.status, students.avatar FROM education.teachers JOIN education.students ON teachers.student_id = students.id ORDER BY body ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, body, tags for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, tags FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, tags FROM education.teachers WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, tags FROM education.teachers WHERE updated_at > '2023-01-01' ORDER BY post_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers where post_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE post_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of teachers in each user_id category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.teachers GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "List post_id, updated_at, body from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, updated_at, body FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by student_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT post_id, updated_at, body FROM education.teachers ORDER BY student_id DESC;", "sql": null}, {"role": "user", "content": "Get sum of media_url by post_id from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, SUM(media_url) AS sum_media_url FROM education.teachers GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Get tags, student_id, updated_at from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT tags, student_id, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT tags, student_id, updated_at FROM education.teachers WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT tags, student_id, updated_at FROM education.teachers WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY edited_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Retrieve media_url, post_id, body for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, post_id, body FROM education.teachers;", "sql": null}, {"role": "user", "content": "Sort the results by student_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, post_id, body FROM education.teachers ORDER BY student_id ASC;", "sql": null}, {"role": "user", "content": "How many teachers are there per body?", "sql": null}, {"role": "assistant", "content": "SELECT body, COUNT(*) AS count FROM education.teachers GROUP BY body ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "Retrieve edited_at, post_id, updated_at for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, post_id, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, post_id, updated_at FROM education.teachers ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "What is the max user_id for each tags in teachers?", "sql": null}, {"role": "assistant", "content": "SELECT tags, MAX(user_id) AS max_user_id FROM education.teachers GROUP BY tags;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show the results sorted by post_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY post_id DESC;", "sql": null}, {"role": "user", "content": "Tally up teachers by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM education.teachers GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at timestamp,\n country character varying(128),\n status character varying(256),\n gender character varying(128),\n avatar character varying(128)\n)\n\nCREATE TABLE education.teachers (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n updated_at date,\n tags varchar NOT NULL,\n image_url character varying(256),\n body text,\n description char NOT NULL,\n user_id character varying(64),\n media_url character varying(128),\n student_id text -- reference to students.id,\n FOREIGN KEY (student_id) REFERENCES students(id)\n)", "conversations": [{"role": "user", "content": "List user_id, body, updated_at from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, updated_at FROM education.teachers WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, body, updated_at FROM education.teachers WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get tags, group_id, image_url from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT tags, group_id, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List group_id, format, card_type, price for each message along with their group information.", "sql": null}, {"role": "assistant", "content": "SELECT tags, group_id, image_url, groups.card_type, groups.price FROM socialmedia.messages JOIN socialmedia.groups ON messages.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM socialmedia.messages GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What tags, user_id, price, user_id do we have for messages and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.price, groups.user_id FROM socialmedia.messages JOIN socialmedia.groups ON messages.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Sort the results by image_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.price, groups.user_id FROM socialmedia.messages JOIN socialmedia.groups ON messages.group_id = groups.payment_id ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "What are the image_url, user_id, author_id of each message?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, user_id, author_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, user_id, author_id FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, user_id, author_id FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get author_id, user_id, id from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, user_id, id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Order the output by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, user_id, id FROM socialmedia.messages ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by tags descending.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, user_id, id FROM socialmedia.messages ORDER BY tags DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get author_id, group_id, image_url from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, group_id, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages from last week.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, group_id, image_url FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, group_id, image_url FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me group_id, author_id, image_url for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, author_id, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Arrange the results with edited_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, author_id, image_url FROM socialmedia.messages ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "What is the count tags for each image_url in messages?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(tags) AS count_tags FROM socialmedia.messages GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get tags, edited_at, traded_at, payment_status by joining messages with groups.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.traded_at, groups.payment_status FROM socialmedia.messages JOIN socialmedia.groups ON messages.group_id = groups.payment_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.traded_at, groups.payment_status FROM socialmedia.messages JOIN socialmedia.groups ON messages.group_id = groups.payment_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me author_id, image_url, tags for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, image_url, tags FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, image_url, tags FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, image_url, tags FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n author_id char NOT NULL,\n tags char,\n image_url character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user,\n format char NOT NULL,\n group_id text NOT NULL -- reference to groups.payment_id,\n FOREIGN KEY (group_id) REFERENCES groups(payment_id)\n)\n\nCREATE TABLE socialmedia.groups (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n fee varchar,\n approval_status character varying(64),\n price numeric(38,14),\n payment_method varchar,\n user_id character varying(128),\n payment_status character varying(256) NOT NULL,\n card_type char\n)", "conversations": [{"role": "user", "content": "What are the author_id, tags, image_url of each message?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, tags, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages with tags LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, tags, image_url FROM socialmedia.messages WHERE tags LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, tags, image_url FROM socialmedia.messages WHERE tags LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "List full_name, timezone, first_name from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, timezone, first_name FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get last_active, website, nationality, display_name by joining medical_records with billing.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, timezone, first_name, billing.nationality, billing.display_name FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.customer_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by first_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, timezone, first_name, billing.nationality, billing.display_name FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.customer_id ORDER BY first_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many appointments are there per salt?", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM healthcare.appointments GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "Get billin_id, created_at, address from all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, address FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List zip_code, created_at, created_at, nationality for each appointment along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, address, billing.created_at, billing.nationality FROM healthcare.appointments JOIN healthcare.billing ON appointments.billin_id = billing.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, address, billing.created_at, billing.nationality FROM healthcare.appointments JOIN healthcare.billing ON appointments.billin_id = billing.customer_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List billin_id, created_at, created_at, nationality for each medical_record along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.created_at, billing.nationality FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.customer_id;", "sql": null}, {"role": "user", "content": "Get min of first_name by billin_id from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, MIN(first_name) AS min_first_name FROM healthcare.medical_records GROUP BY billin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve billin_id, website, salt for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, website, salt FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get medical_records that match timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, website, salt FROM healthcare.medical_records WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me first_name, billin_id, salt for all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, billin_id, salt FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records that have salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, billin_id, salt FROM healthcare.medical_records WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, billin_id, salt FROM healthcare.medical_records WHERE salt LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by billin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY billin_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "List language, billin_id, address from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, address FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, address FROM healthcare.appointments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, address FROM healthcare.appointments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "List created_at, full_name, timezone from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, timezone FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me salt, full_name, created_at, joined_at from medical_records and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, timezone, billing.created_at, billing.joined_at FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.customer_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, timezone, billing.created_at, billing.joined_at FROM healthcare.medical_records JOIN healthcare.billing ON medical_records.billin_id = billing.customer_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at date,\n first_name text,\n website character varying(256),\n full_name varchar,\n timezone character varying(64),\n salt text,\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n display_name char,\n nationality char,\n gender character varying(64),\n bio varchar,\n birth_date timestamp without time zone NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n gender varchar,\n zip_code text,\n language character varying(128),\n salt varchar,\n address character varying(256),\n billin_id text -- reference to billing.customer_id,\n FOREIGN KEY (billin_id) REFERENCES billing(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the billin_id, salt, full_name of each medical_record?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, salt, full_name FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, salt, full_name FROM healthcare.medical_records ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, salt, full_name FROM healthcare.medical_records ORDER BY last_active ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "List updated_at, popularity_score, rating from assets.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, rating FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me rating, category, category, updated_at from assets and their related wallets.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, rating, wallets.category, wallets.updated_at FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, rating, wallets.category, wallets.updated_at FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve product_id, wallet_id, created_at for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, wallet_id, created_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show the results sorted by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, wallet_id, created_at FROM tradingplatform.assets ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "Show me the count of assets grouped by popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(*) AS count FROM tradingplatform.assets GROUP BY popularity_score ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "Get category, media_url, popularity_score from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT category, media_url, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Sort the results by thumbnail_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT category, media_url, popularity_score FROM tradingplatform.assets ORDER BY thumbnail_url DESC;", "sql": null}, {"role": "user", "content": "Tally up assets by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM tradingplatform.assets GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What rating, updated_at, customer_id, payer_id do we have for assets and their associated wallets?", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.customer_id, wallets.payer_id FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Arrange the results with wallet_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.customer_id, wallets.payer_id FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id ORDER BY wallet_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get assets that match category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different product_id values.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by product_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE popularity_score LIKE 'A%' ORDER BY product_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve rating, media_url, product_id for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT rating, media_url, product_id FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT rating, media_url, product_id FROM tradingplatform.assets WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT rating, media_url, product_id FROM tradingplatform.assets WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "List product_id, created_at, updated_at from assets.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, created_at, updated_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List rating, popularity_score, customer_id, approval_status for each asset along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, created_at, updated_at, wallets.customer_id, wallets.approval_status FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Can you order these by wallet_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, created_at, updated_at, wallets.customer_id, wallets.approval_status FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id ORDER BY wallet_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List assets with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the max rating for each popularity_score in assets?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, MAX(rating) AS max_rating FROM tradingplatform.assets GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n delivery_status character varying(256),\n user_id character varying(256) -- identifier for user,\n status varchar\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n thumbnail_url char,\n media_url character varying(128),\n rating char,\n image_url character varying(128),\n category varchar,\n popularity_score character varying(256),\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp,\n approval_status character varying(128),\n customer_id char NOT NULL,\n category character varying(128),\n reference_number character varying(128),\n exchange_rate varchar,\n payer_id character varying(64) NOT NULL,\n description character varying(64)\n)", "conversations": [{"role": "user", "content": "List category, image_url, popularity_score from assets.", "sql": null}, {"role": "assistant", "content": "SELECT category, image_url, popularity_score FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What media_url, thumbnail_url, category, payer_id do we have for assets and their associated wallets?", "sql": null}, {"role": "assistant", "content": "SELECT category, image_url, popularity_score, wallets.category, wallets.payer_id FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Sort the results by image_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, image_url, popularity_score, wallets.category, wallets.payer_id FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get address, display_name, created_at from all users.", "sql": null}, {"role": "assistant", "content": "SELECT address, display_name, created_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by address descending.", "sql": null}, {"role": "assistant", "content": "SELECT address, display_name, created_at FROM socialmedia.users ORDER BY address DESC;", "sql": null}, {"role": "user", "content": "Tally up users by address.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM socialmedia.users GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, created_at, display_name for every user.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, created_at, display_name FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have address LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, created_at, display_name FROM socialmedia.users WHERE address LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, created_at, display_name FROM socialmedia.users WHERE address LIKE 'A%' ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List video_url, expires_at, featured_rank from groups.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, expires_at, featured_rank FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, expires_at, featured_rank FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, expires_at, featured_rank FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the subcategory, brand, expires_at of each group?", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, brand, expires_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Sort the results by subcategory ascending.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, brand, expires_at FROM socialmedia.groups ORDER BY subcategory ASC;", "sql": null}, {"role": "user", "content": "Tally up groups by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM socialmedia.groups GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by visibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY visibility ASC;", "sql": null}, {"role": "user", "content": "Can you order these by visibility ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY visibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by tags ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY tags ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY display_name DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY display_name DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve name, featured_rank, subcategory for every group.", "sql": null}, {"role": "assistant", "content": "SELECT name, featured_rank, subcategory FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get all groups created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT name, featured_rank, subcategory FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with barcode in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT name, featured_rank, subcategory FROM socialmedia.groups WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY barcode DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups that have name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of updated_at for each updated_at in groups.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(updated_at) AS max_updated_at FROM socialmedia.groups GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url char,\n visibility character varying(64) NOT NULL,\n tags character varying(128),\n keywords character varying(64),\n user_id text -- identifier for user,\n thumbnail character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n expires_at date,\n tax_rate character varying(64),\n subcategory varchar NOT NULL,\n video_url text -- identifier for video_url,\n featured_rank varchar,\n name character varying(64),\n backorder varchar,\n brand char\n)\n\nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n address char,\n account_status character varying(64),\n display_name varchar,\n last_name char NOT NULL,\n age character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show me sum of barcode grouped by brand for groups.", "sql": null}, {"role": "assistant", "content": "SELECT brand, SUM(barcode) AS sum_barcode FROM socialmedia.groups GROUP BY brand;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "What are the id, created_at, profile_picture_url of each user?", "sql": null}, {"role": "assistant", "content": "SELECT id, created_at, profile_picture_url FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users with language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, created_at, profile_picture_url FROM tradingplatform.users WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up users by language.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(*) AS count FROM tradingplatform.users GROUP BY language ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "List asset_id, created_at, category from logs.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, created_at, category FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, created_at, category FROM tradingplatform.logs WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up logs by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM tradingplatform.logs GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Get metadat_id, location_id, parking_available from all logs.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, location_id, parking_available FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with category in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, location_id, parking_available FROM tradingplatform.logs ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, location_id, parking_available FROM tradingplatform.logs ORDER BY category ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve location_id, location_lat, name for every log.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, location_lat, name FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with parking_available in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, location_lat, name FROM tradingplatform.logs ORDER BY parking_available ASC;", "sql": null}, {"role": "user", "content": "Show me the count of logs grouped by asset_id.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, COUNT(*) AS count FROM tradingplatform.logs GROUP BY asset_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show the results sorted by location_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY location_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of logs grouped by parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM tradingplatform.logs GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve parking_available, location_id, name for every log.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, location_id, name FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Order the output by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, location_id, name FROM tradingplatform.logs ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Order the output by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, location_id, name FROM tradingplatform.logs ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n reserved character varying(64),\n brand character varying(256),\n popularity_score character varying(256),\n backorder character varying(128),\n video_url text -- identifier for video_url,\n stock_level character varying(128)\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n email char,\n account_status character varying(128),\n country char NOT NULL,\n profile_picture_url text NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n profile_picture_url character varying(128),\n address character varying(256),\n country char,\n language char,\n asset_id text NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n name char,\n category varchar,\n location_lat char,\n parking_available character varying(128),\n metadat_id text -- reference to metadata.id,\n asset_id text -- reference to assets.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id),\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me created_at, asset_id, stock_level, video_url from users and their related assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.stock_level, assets.video_url FROM tradingplatform.users JOIN tradingplatform.assets ON users.asset_id = assets.sku;", "sql": null}, {"role": "user", "content": "Get min of asset_id by language from users.", "sql": null}, {"role": "assistant", "content": "SELECT language, MIN(asset_id) AS min_asset_id FROM tradingplatform.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "What are the investment_id, buyer_id, seller_id of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, buyer_id, seller_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by tax ascending.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, buyer_id, seller_id FROM finance.payments ORDER BY tax ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, buyer_id, seller_id FROM finance.payments ORDER BY tax ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "List approval_status, payer_id, payee_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payer_id, payee_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with balance in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payer_id, payee_id FROM finance.accounts ORDER BY balance DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different payer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, COUNT(*) AS count FROM finance.accounts GROUP BY payer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me verification_status, balance, created_at for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, balance, created_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get all accounts older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, balance, created_at FROM finance.accounts WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get max of payee_id by verification_status from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, MAX(payee_id) AS max_payee_id FROM finance.accounts GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me payment_id, balance, investment_id, approval_status from accounts and their related payments.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.investment_id, payments.approval_status FROM finance.accounts JOIN finance.payments ON accounts.payment_id = payments.payment_id;", "sql": null}, {"role": "user", "content": "Show me average of verification_status grouped by payer_id for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, AVERAGE(verification_status) AS average_verification_status FROM finance.accounts GROUP BY payer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, balance, payee_id for every account.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, balance, payee_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, balance, payee_id FROM finance.accounts WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, balance, payee_id FROM finance.accounts WHERE payment_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Order the output by payee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payee_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with payer_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of content for each account_id in investments.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(content) AS count_content FROM finance.investments GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve content, edited_at, account_id for every investment.", "sql": null}, {"role": "assistant", "content": "SELECT content, edited_at, account_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show me investments with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT content, edited_at, account_id FROM finance.investments WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT content, edited_at, account_id FROM finance.investments WHERE media_url LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payer_id character varying(128) NOT NULL -- identifier for payer,\n credit character varying(256),\n payee_id varchar -- identifier for payee,\n balance decimal,\n approval_status varchar,\n category character varying(256),\n verification_status character varying(64) NOT NULL,\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n content varchar,\n media_url varchar,\n author_id char -- identifier for author,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n delivery_status varchar,\n approval_status text,\n buyer_id character varying(64),\n seller_id varchar,\n quantity character varying(128),\n tax numeric(38,14),\n investment_id integer -- reference to investments.content_id,\n FOREIGN KEY (investment_id) REFERENCES investments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with delivery_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets that have trade_id > 53.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE trade_id > 53;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE trade_id > 53 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "What is the sum wallet_id for each created_at in orders?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(wallet_id) AS sum_wallet_id FROM tradingplatform.orders GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get trades that match traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate average of quantity for each wallet_id in trades.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, AVERAGE(quantity) AS average_quantity FROM tradingplatform.trades GROUP BY wallet_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me buyer_id, payment_status, created_at for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_status, created_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_status, created_at FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_status, created_at FROM tradingplatform.orders WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show me trades with quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE quantity LIKE 'A%' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me wallets with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE verification_status LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where payer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of invoice_number by created_at from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(invoice_number) AS max_invoice_number FROM tradingplatform.wallets GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get delivery_status, approval_status, quantity from all trades.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, approval_status, quantity FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, approval_status, quantity FROM tradingplatform.trades WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, approval_status, quantity FROM tradingplatform.trades WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n user_id character varying(256),\n approval_status character varying(128),\n delivery_status character varying(256),\n quantity character varying(64) NOT NULL,\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.orders (\n order_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at date,\n payment_status character varying(64),\n amount integer,\n card_type character varying(128),\n quantity character varying(128),\n buyer_id character varying(256),\n currency text,\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n invoice_number varchar,\n approval_status char,\n debit character varying(256),\n verification_status character varying(256),\n payer_id character varying(64) -- identifier for payer,\n trade_id integer -- reference to trades.invoice_id,\n FOREIGN KEY (trade_id) REFERENCES trades(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me user_id, delivery_status, payment_method for all trades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, delivery_status, payment_method FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, delivery_status, payment_method FROM tradingplatform.trades WHERE traded_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Order the output by quantity descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, delivery_status, payment_method FROM tradingplatform.trades WHERE traded_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the currency, approval_status, customer_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, customer_id FROM finance.accounts WHERE payment_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of accounts grouped by verification_status.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM finance.accounts GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List verification_status, user_id, credit from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, user_id, credit FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List approval_status, currency, profile_picture_url, last_active for each account along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, user_id, credit, customers.profile_picture_url, customers.last_active FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Can you order these by currency descending?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, user_id, credit, customers.profile_picture_url, customers.last_active FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.id ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me exchange_rate, currency, profile_picture_url, username from accounts and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.profile_picture_url, customers.username FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Show me max of user_id grouped by customer_id for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(user_id) AS max_user_id FROM finance.accounts GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the payment_date, credit, debit of each account?", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, credit, debit FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, credit, debit FROM finance.accounts WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group accounts by credit and show the sum of customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT credit, SUM(customer_id) AS sum_customer_id FROM finance.accounts GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List customer_id, payment_date, due_date from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_date, due_date FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Sort the results by verification_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_date, due_date FROM finance.accounts ORDER BY verification_status ASC;", "sql": null}, {"role": "user", "content": "Group accounts by credit and show the count of payment_date.", "sql": null}, {"role": "assistant", "content": "SELECT credit, COUNT(payment_date) AS count_payment_date FROM finance.accounts GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE approval_status LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE currency LIKE 'A%' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the credit, user_id, verification_status of each account?", "sql": null}, {"role": "assistant", "content": "SELECT credit, user_id, verification_status FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show the results sorted by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT credit, user_id, verification_status FROM finance.accounts ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Show me the count of accounts grouped by verification_status.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM finance.accounts GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with due_date in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months' ORDER BY due_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n debit text NOT NULL,\n approval_status text,\n user_id character varying(256) NOT NULL -- identifier for user,\n currency varchar,\n verification_status character varying(64),\n credit character varying(64),\n exchange_rate varchar,\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n username character varying(64),\n nationality varchar,\n profile_picture_url character varying(64),\n last_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get user_id, credit, due_date from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, credit, due_date FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, credit, due_date FROM finance.accounts WHERE due_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, credit, due_date FROM finance.accounts WHERE due_date > '2023-12-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of customers in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.customers GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List employee_id, display_name, status from customers.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, display_name, status FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, display_name, status FROM finance.customers WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many customers are there per employee_id?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, COUNT(*) AS count FROM finance.customers GROUP BY employee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve status, display_name, balance, created_at showing the relationship between customers and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.balance, accounts.created_at FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Get average of website by employee_id from customers.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, AVERAGE(website) AS average_website FROM finance.customers GROUP BY employee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Get min of account_id by website from customers.", "sql": null}, {"role": "assistant", "content": "SELECT website, MIN(account_id) AS min_account_id FROM finance.customers GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get sum of website by created_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(website) AS sum_website FROM finance.customers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers that have employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count created_at for each account_id in customers?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(created_at) AS count_created_at FROM finance.customers GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve employee_id, account_id, website for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, account_id, website FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve created_at, website, payment_date, balance showing the relationship between customers and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, account_id, website, accounts.payment_date, accounts.balance FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "How many customers are there per status?", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM finance.customers GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, account_id, status for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_id, status FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by website ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, account_id, status FROM finance.customers ORDER BY website ASC;", "sql": null}, {"role": "user", "content": "Show me average of created_at grouped by display_name for customers.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, AVERAGE(created_at) AS average_created_at FROM finance.customers GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List account_id, created_at, created_at, status for each customer along with their account information.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.created_at, accounts.status FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM finance.customers GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n created_at timestamp,\n payer_id character varying(128) -- identifier for payer,\n invoice_number text NOT NULL,\n vendor_id varchar -- identifier for vendor,\n status varchar,\n balance numeric NOT NULL,\n user_id text -- identifier for user\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n status varchar,\n display_name varchar,\n website character varying(128),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by website ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-12-01' ORDER BY website ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY currency DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List discount, cancelled_at, currency from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, currency FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, currency FROM healthcare.appointments WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the count card_type for each processed_at in appointments?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(card_type) AS count_card_type FROM healthcare.appointments GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY card_type DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY card_type DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me joined_at, last_active, cancelled_at, card_type from prescriptions and their related appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.cancelled_at, appointments.card_type FROM healthcare.prescriptions JOIN healthcare.appointments ON prescriptions.appointment_id = appointments.id;", "sql": null}, {"role": "user", "content": "Show me sum of appointment_id grouped by appointment_id for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, SUM(appointment_id) AS sum_appointment_id FROM healthcare.prescriptions GROUP BY appointment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where prescription_id > 57.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE prescription_id > 57;", "sql": null}, {"role": "user", "content": "Get min of user_id by cancelled_at from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, MIN(user_id) AS min_user_id FROM healthcare.appointments GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve card_type, discount, currency for every appointment.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, discount, currency FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have prescription_id > 93.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, discount, currency FROM healthcare.appointments WHERE prescription_id > 93;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, discount, currency FROM healthcare.appointments WHERE prescription_id > 93 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List processed_at, discount, card_type from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, discount, card_type FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have discount > 41.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, discount, card_type FROM healthcare.appointments WHERE discount > 41;", "sql": null}, {"role": "user", "content": "Order the output by cancelled_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, discount, card_type FROM healthcare.appointments WHERE discount > 41 ORDER BY cancelled_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me birth_date, gender, discount, currency from prescriptions and their related appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.discount, appointments.currency FROM healthcare.prescriptions JOIN healthcare.appointments ON prescriptions.appointment_id = appointments.id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.discount, appointments.currency FROM healthcare.prescriptions JOIN healthcare.appointments ON prescriptions.appointment_id = appointments.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n birth_date timestamp,\n password_hash character varying(128) NOT NULL,\n country char NOT NULL,\n website character varying(256),\n gender character varying(256),\n appointment_id text NOT NULL -- reference to appointments.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(id)\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n last_name char,\n nationality character varying(256),\n email character varying(64) NOT NULL,\n timezone varchar,\n membership_level character varying(256),\n profile_picture_url character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)\n\nCREATE TABLE healthcare.appointments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at date,\n user_id character varying(256) -- identifier for user,\n card_type character varying(128),\n discount smallint NOT NULL,\n currency character varying(64),\n payment_method varchar NOT NULL,\n prescription_id integer -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve discount, currency, card_type for every appointment.", "sql": null}, {"role": "assistant", "content": "SELECT discount, currency, card_type FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments with cancelled_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT discount, currency, card_type FROM healthcare.appointments WHERE cancelled_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many appointments are there per cancelled_at?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM healthcare.appointments GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Get all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.finances;", "sql": null}, {"role": "user", "content": "List finances that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.finances WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of finances grouped by id.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM humanresources.finances GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE published_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Get visibility, published_at, catalo_id from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, published_at, catalo_id FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, published_at, catalo_id FROM humanresources.messages ORDER BY views DESC;", "sql": null}, {"role": "user", "content": "How many messages are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM humanresources.messages GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Get catalo_id, user_id, customer_id from all finances.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, user_id, customer_id FROM humanresources.finances;", "sql": null}, {"role": "user", "content": "List finances with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, user_id, customer_id FROM humanresources.finances WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, user_id, customer_id FROM humanresources.finances WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages ORDER BY published_at ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Retrieve views, visibility, created_at, image_url showing the relationship between messages and catalog.", "sql": null}, {"role": "assistant", "content": "SELECT *, catalog.created_at, catalog.image_url FROM humanresources.messages JOIN humanresources.catalog ON messages.catalo_id = catalog.item_id;", "sql": null}, {"role": "user", "content": "Calculate max of edited_at for each catalo_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, MAX(edited_at) AS max_edited_at FROM humanresources.messages GROUP BY catalo_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "List catalo_id, published_at, reply_to_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, published_at, reply_to_id FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Get all messages created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT catalo_id, published_at, reply_to_id FROM humanresources.messages WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different published_at values.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM humanresources.messages GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.messages (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n visibility char,\n format varchar,\n keywords char,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(128) -- identifier for reply_to,\n views char,\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE humanresources.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail_url varchar NOT NULL,\n image_url varchar,\n media_url character varying(256),\n currency char\n)\n\nCREATE TABLE humanresources.finances (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n customer_id character varying(64),\n verification_status character varying(64),\n invoice_number char,\n payer_id character varying(64),\n user_id varchar -- identifier for user,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n message_id integer NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id),\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Find messages where catalo_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE catalo_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM humanresources.messages GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get geo_point, created_at, buyer_id, payment_status by joining enrollments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.buyer_id, grades.payment_status FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.payment_id;", "sql": null}, {"role": "user", "content": "Calculate min of address_line2 for each address_line2 in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, MIN(address_line2) AS min_address_line2 FROM education.enrollments GROUP BY address_line2;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many enrollments are there per address_id?", "sql": null}, {"role": "assistant", "content": "SELECT address_id, COUNT(*) AS count FROM education.enrollments GROUP BY address_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get address_id, address_line2, grade_id from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, address_line2, grade_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, address_line2, grade_id FROM education.enrollments WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, address_line2, grade_id FROM education.enrollments WHERE geo_point LIKE 'A%' ORDER BY accessibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List address_line2, address_id, accessibility from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, address_id, accessibility FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, address_id, accessibility FROM education.enrollments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me count of operating_hours grouped by accessibility for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(operating_hours) AS count_operating_hours FROM education.enrollments GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by grade_id.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.enrollments GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get grade_id, address_line2, created_at from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, address_line2, created_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, address_line2, created_at FROM education.enrollments WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me min of address_line2 grouped by operating_hours for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, MIN(address_line2) AS min_address_line2 FROM education.enrollments GROUP BY operating_hours;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List operating_hours, address_line2, geo_point from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, geo_point FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, geo_point FROM education.enrollments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group enrollments by geo_point and show the sum of operating_hours.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, SUM(operating_hours) AS sum_operating_hours FROM education.enrollments GROUP BY geo_point;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List operating_hours, address_line2, grade_id from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, grade_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get enrollments that match address_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, address_line2, grade_id FROM education.enrollments WHERE address_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.enrollments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n address_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n operating_hours character varying(128),\n geo_point char NOT NULL,\n accessibility char NOT NULL,\n address_line2 character varying(128),\n grade_id text NOT NULL -- reference to grades.payment_id,\n FOREIGN KEY (grade_id) REFERENCES grades(payment_id)\n)\n\nCREATE TABLE education.grades (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n card_type character varying(64),\n buyer_id varchar -- identifier for buyer,\n payment_method varchar NOT NULL,\n payment_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "What geo_point, created_at, traded_at, payment_status do we have for enrollments and their associated grades?", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.traded_at, grades.payment_status FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.payment_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.traded_at, grades.payment_status FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.payment_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, venue_id, geo_point for every course.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, venue_id, geo_point FROM education.courses;", "sql": null}, {"role": "user", "content": "Can you order these by venue_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, venue_id, geo_point FROM education.courses ORDER BY venue_id DESC;", "sql": null}, {"role": "user", "content": "Calculate average of location_lat for each category in courses.", "sql": null}, {"role": "assistant", "content": "SELECT category, AVERAGE(location_lat) AS average_location_lat FROM education.courses GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Arrange the results with geo_point in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY geo_point DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY geo_point DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up courses by venue_id.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, COUNT(*) AS count FROM education.courses GROUP BY venue_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Can you order these by location_lat descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY location_lat DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of location_lon for each updated_at in departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(location_lon) AS min_location_lon FROM education.departments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, type, updated_at for every course.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, type, updated_at FROM education.courses;", "sql": null}, {"role": "user", "content": "Get all courses created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, type, updated_at FROM education.courses WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up courses by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.courses GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n capacity char,\n location_lat text,\n type char,\n geo_point varchar NOT NULL,\n category varchar,\n enrollment_id text NOT NULL -- reference to enrollments.person_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.departments (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n coordinates char,\n name character varying(256),\n timezone character varying(64),\n longitude character varying(64) NOT NULL,\n parking_available character varying(128),\n operating_hours char NOT NULL,\n location_lon character varying(64),\n assignment_id text NOT NULL -- reference to assignments.id,\n enrollment_id text -- reference to enrollments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(person_id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n type text NOT NULL,\n latitude character varying(128),\n category character varying(256)\n)\n\nCREATE TABLE education.enrollments (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n website character varying(64),\n is_active bit,\n state varchar NOT NULL,\n city varchar\n)", "conversations": [{"role": "user", "content": "Show me all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me courses that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate max of capacity for each venue_id in courses.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, MAX(capacity) AS max_capacity FROM education.courses GROUP BY venue_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n payment_method text,\n quantity character varying(256),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.loans (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility char,\n latitude varchar,\n account_id text -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at timestamp without time zone,\n currency text,\n status character varying(256),\n user_id character varying(64) -- identifier for user,\n product_id character varying(256),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n payer_id character varying(128) -- identifier for payer,\n debit character varying(256) NOT NULL,\n customer_id character varying(256) NOT NULL,\n reconciliation_status varchar,\n notes character varying(128),\n transaction_id text -- reference to transactions.id,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id),\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show the results sorted by payer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payer_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What score, published_at, categories, updated_at do we have for messages and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.categories, posts.updated_at FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Get max of media_url by author_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, MAX(media_url) AS max_media_url FROM socialmedia.messages GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Get score, post_id, published_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, post_id, published_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages from last week.", "sql": null}, {"role": "assistant", "content": "SELECT score, post_id, published_at FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM socialmedia.messages GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by tags ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY tags ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate average of published_at for each author_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, AVERAGE(published_at) AS average_published_at FROM socialmedia.messages GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "List post_id, shares, published_at from messages.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, shares, published_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, shares, published_at FROM socialmedia.messages WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different media_url values.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM socialmedia.messages GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Get score, post_id, published_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, post_id, published_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Can you order these by post_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT score, post_id, published_at FROM socialmedia.messages ORDER BY post_id DESC;", "sql": null}, {"role": "user", "content": "Show me min of score grouped by score for messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, MIN(score) AS min_score FROM socialmedia.messages GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get max of shares by post_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, MAX(shares) AS max_shares FROM socialmedia.messages GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where post_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE post_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE post_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me sum of published_at grouped by media_url for messages.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, SUM(published_at) AS sum_published_at FROM socialmedia.messages GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tags character varying(64) NOT NULL,\n score character varying(256),\n author_id character varying(64) -- identifier for author,\n media_url character varying(256),\n shares character varying(128),\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n subject character varying(64) NOT NULL,\n categories character varying(128) NOT NULL,\n description varchar\n)", "conversations": [{"role": "user", "content": "What are the published_at, post_id, media_url of each message?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, post_id, media_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get media_url, author_id, updated_at, subject by joining messages with posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, post_id, media_url, posts.updated_at, posts.subject FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.comment_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, post_id, media_url, posts.updated_at, posts.subject FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.comment_id ORDER BY media_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "Show me billin_id, gender, joined_at for all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, gender, joined_at FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by gender ascending.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, gender, joined_at FROM healthcare.appointments ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, gender, joined_at FROM healthcare.appointments ORDER BY gender ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "Get gender, billin_id, is_verified from all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT gender, billin_id, is_verified FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by gender ascending.", "sql": null}, {"role": "assistant", "content": "SELECT gender, billin_id, is_verified FROM healthcare.appointments ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Group appointments by joined_at and show the average of is_verified.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, AVERAGE(is_verified) AS average_is_verified FROM healthcare.appointments GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "List category, prescription_id, media_url from billing.", "sql": null}, {"role": "assistant", "content": "SELECT category, prescription_id, media_url FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, prescription_id, media_url FROM healthcare.billing WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of billing grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM healthcare.billing GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by is_verified ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY is_verified ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by billin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY billin_id DESC;", "sql": null}, {"role": "user", "content": "How many appointments are there per billin_id?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, COUNT(*) AS count FROM healthcare.appointments GROUP BY billin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n location_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n street character varying(256),\n latitude character varying(256) NOT NULL,\n category character varying(256),\n address_line1 char,\n geo_point text,\n billin_id integer NOT NULL -- reference to billing.barcode,\n appointment_id text -- reference to appointments.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at date,\n featured_rank text NOT NULL,\n media_url varchar,\n cost decimal,\n tax_rate character varying(256),\n category character varying(256),\n stock_level text,\n prescription_id text NOT NULL -- reference to prescriptions.location_id,\n appointment_id text NOT NULL -- reference to appointments.user_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(location_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(user_id)\n)\n\nCREATE TABLE healthcare.appointments (\n user_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n gender character varying(64),\n password_hash varchar,\n is_verified boolean,\n billin_id integer NOT NULL -- reference to billing.barcode,\n FOREIGN KEY (billin_id) REFERENCES billing(barcode)\n)", "conversations": [{"role": "user", "content": "Get media_url, published_at, stock_level from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, published_at, stock_level FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match featured_rank LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, published_at, stock_level FROM healthcare.billing WHERE featured_rank LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up billing by appointment_id.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, COUNT(*) AS count FROM healthcare.billing GROUP BY appointment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve status, updated_at, full_name for every user.", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, full_name FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What full_name, joined_at, media_url, updated_at do we have for users and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, full_name, posts.media_url, posts.updated_at FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT status, updated_at, full_name, posts.media_url, posts.updated_at FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, customer_id, status of each user?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, customer_id, status FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, customer_id, status FROM socialmedia.users WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM socialmedia.users GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with full_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY full_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve post_id, status, updated_at for every user.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, status, updated_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users where website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, status, updated_at FROM socialmedia.users WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum username for each is_active in users?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, SUM(username) AS sum_username FROM socialmedia.users GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the full_name, is_active, joined_at of each user?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, is_active, joined_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, is_active, joined_at FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, is_active, joined_at FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Get membership_level, is_active, username from all users.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, is_active, username FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get users that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, is_active, username FROM socialmedia.users WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, is_active, username FROM socialmedia.users WHERE updated_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the status, full_name, joined_at of each user?", "sql": null}, {"role": "assistant", "content": "SELECT status, full_name, joined_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve post_id, website, title, user_id showing the relationship between users and posts.", "sql": null}, {"role": "assistant", "content": "SELECT status, full_name, joined_at, posts.title, posts.user_id FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id;", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT status, full_name, joined_at, posts.title, posts.user_id FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "What is the count membership_level for each username in users?", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(membership_level) AS count_membership_level FROM socialmedia.users GROUP BY username;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve membership_level, is_active, media_url, categories showing the relationship between users and posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.media_url, posts.categories FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id;", "sql": null}, {"role": "user", "content": "Order the output by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.media_url, posts.categories FROM socialmedia.users JOIN socialmedia.posts ON users.post_id = posts.post_id ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n updated_at date,\n membership_level char,\n status varchar NOT NULL,\n full_name text,\n username character varying(64) NOT NULL,\n website character varying(64),\n is_active boolean -- indicates if active is true,\n post_id integer NOT NULL -- reference to posts.post_id,\n FOREIGN KEY (post_id) REFERENCES posts(post_id)\n)\n\nCREATE TABLE socialmedia.posts (\n post_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n user_id character varying(256) -- identifier for user,\n categories text,\n media_url varchar NOT NULL,\n image_url varchar,\n title character varying(128)\n)", "conversations": [{"role": "user", "content": "Get is_active, status, customer_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, status, customer_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, status, customer_id FROM socialmedia.users WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me sum of updated_at grouped by joined_at for users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, SUM(updated_at) AS sum_updated_at FROM socialmedia.users GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Find accounts where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of created_at by reservation_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, SUM(created_at) AS sum_created_at FROM marketing.accounts GROUP BY reservation_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "List user_id, merchandis_id, reservation_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, merchandis_id, reservation_id FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by merchandis_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, merchandis_id, reservation_id FROM marketing.accounts ORDER BY merchandis_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by merchandis_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, merchandis_id, reservation_id FROM marketing.accounts ORDER BY merchandis_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all employees.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.employees;", "sql": null}, {"role": "user", "content": "Show me employees that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.employees WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up employees by api_key.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM marketing.employees GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "List all employees.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.employees;", "sql": null}, {"role": "user", "content": "Retrieve employees where id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.employees WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of merchandis_id by city from employees.", "sql": null}, {"role": "assistant", "content": "SELECT city, SUM(merchandis_id) AS sum_merchandis_id FROM marketing.employees GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Find accounts where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get sum of user_id by category from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT category, SUM(user_id) AS sum_user_id FROM marketing.accounts GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "Show me merchandis_id, category, created_at for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, category, created_at FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with category in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, category, created_at FROM marketing.accounts ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different category values.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM marketing.accounts GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match reservation_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts WHERE reservation_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts WHERE reservation_id LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "What are the merchandis_id, created_at, user_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, created_at, user_id FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, created_at, user_id FROM marketing.accounts WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, created_at, user_id FROM marketing.accounts WHERE user_id LIKE 'A%' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.merchandise (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n reserved char,\n popularity_score varchar,\n cost numeric(38,14) NOT NULL,\n backorder character varying(256) NOT NULL\n)\n\nCREATE TABLE marketing.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n customer_id text NOT NULL,\n category character varying(128) NOT NULL,\n user_id character varying(256) NOT NULL -- identifier for user,\n reservation_id text NOT NULL -- reference to reservations.invoice_id,\n merchandis_id text NOT NULL -- reference to merchandise.barcode,\n FOREIGN KEY (reservation_id) REFERENCES reservations(invoice_id),\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)\n\nCREATE TABLE marketing.reservations (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n card_type text,\n exchange_rate text\n)\n\nCREATE TABLE marketing.employees (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n api_key varchar,\n city char,\n is_verified boolean -- indicates if verified is true,\n merchandis_id text -- reference to merchandise.barcode,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(barcode)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts;", "sql": null}, {"role": "user", "content": "Find accounts created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.accounts WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "What is the count user_id for each created_at in accounts?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(user_id) AS count_user_id FROM marketing.accounts GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get city, patient_id, category, patient_id by joining billing with appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.category, appointments.patient_id FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.product_id;", "sql": null}, {"role": "user", "content": "What is the count last_inspected for each patient_id in billing?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(last_inspected) AS count_last_inspected FROM healthcare.billing GROUP BY patient_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Calculate count of category for each popularity_score in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(category) AS count_category FROM healthcare.appointments GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get image_url, category, token, state by joining appointments with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.token, patients.state FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Can you order these by patient_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.token, patients.state FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id ORDER BY patient_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, patient_id, capacity for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, patient_id, capacity FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing with city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, patient_id, capacity FROM healthcare.billing WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by capacity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, patient_id, capacity FROM healthcare.billing WHERE city LIKE 'A%' ORDER BY capacity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List last_inspected, city, category, image_url for each billing along with their appointment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.category, appointments.image_url FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.product_id;", "sql": null}, {"role": "user", "content": "Tally up billing by capacity.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM healthcare.billing GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up patients by language.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(*) AS count FROM healthcare.patients GROUP BY language ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM healthcare.appointments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "List all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me cost, category, username, language from appointments and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.username, patients.language FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Order the output by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.username, patients.language FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id ORDER BY stock_level ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(128),\n capacity character varying(256),\n city character varying(64),\n appointment_id text -- reference to appointments.product_id,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id),\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n popularity_score varchar,\n stock_level varchar NOT NULL,\n cost numeric(38,14) NOT NULL,\n category character varying(64),\n image_url character varying(64),\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n state text,\n token char,\n website character varying(256),\n username varchar,\n language text,\n appointment_id text NOT NULL -- reference to appointments.product_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match token LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE token LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE token LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve order_item_id, currency, item_id for every product.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, currency, item_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, currency, item_id FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of products in each item_id category.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, COUNT(*) AS count FROM e-commerce.products GROUP BY item_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Get cost, currency, published_at from all products.", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, published_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, published_at FROM e-commerce.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by available ascending?", "sql": null}, {"role": "assistant", "content": "SELECT cost, currency, published_at FROM e-commerce.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "List item_id, currency, cost from products.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, currency, cost FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, currency, cost FROM e-commerce.products WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, currency, cost FROM e-commerce.products WHERE available LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many products are there per order_item_id?", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, COUNT(*) AS count FROM e-commerce.products GROUP BY order_item_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve cost, available, currency for every product.", "sql": null}, {"role": "assistant", "content": "SELECT cost, available, currency FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match order_item_id > 50.", "sql": null}, {"role": "assistant", "content": "SELECT cost, available, currency FROM e-commerce.products WHERE order_item_id > 50;", "sql": null}, {"role": "user", "content": "Sort the results by order_item_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT cost, available, currency FROM e-commerce.products WHERE order_item_id > 50 ORDER BY order_item_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "What are the published_at, currency, cost of each product?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, currency, cost FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What published_at, cost, available, created_at do we have for products and their associated order_items?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, currency, cost, order_items.available, order_items.created_at FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.item_id;", "sql": null}, {"role": "user", "content": "Get the distribution of products across different cost values.", "sql": null}, {"role": "assistant", "content": "SELECT cost, COUNT(*) AS count FROM e-commerce.products GROUP BY cost ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM e-commerce.products GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY available ASC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY available ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group products by order_item_id and show the average of currency.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, AVERAGE(currency) AS average_currency FROM e-commerce.products GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n currency character varying(128),\n discount bigint,\n cost numeric,\n available character varying(64) NOT NULL,\n rating character varying(256),\n video_url character varying(256) NOT NULL -- identifier for video_url\n)\n\nCREATE TABLE e-commerce.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n available character varying(256),\n currency text,\n cost numeric(38,14),\n order_item_id integer NOT NULL -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve cost, published_at, rating, cost showing the relationship between products and order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.rating, order_items.cost FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.item_id;", "sql": null}, {"role": "user", "content": "What is the max cost for each available in products?", "sql": null}, {"role": "assistant", "content": "SELECT available, MAX(cost) AS max_cost FROM e-commerce.products GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where notification_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE notification_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE notification_id LIKE 'A%' ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Get notification_id, joined_at, language from all users.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, joined_at, language FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Order the output by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, joined_at, language FROM tradingplatform.users ORDER BY joined_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, joined_at, language FROM tradingplatform.users ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Show me joined_at, display_name, first_name for all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, display_name, first_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, display_name, first_name FROM tradingplatform.users ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, display_name, first_name FROM tradingplatform.users ORDER BY joined_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Retrieve first_name, language, display_name for every user.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, language, display_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, language, display_name FROM tradingplatform.users WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by notification_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, language, display_name FROM tradingplatform.users WHERE display_name LIKE 'A%' ORDER BY notification_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by display_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY display_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Order the output by reply_to_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY reply_to_id DESC;", "sql": null}, {"role": "user", "content": "Tally up notifications by author_id.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY exchange_rate DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "List payment_status, completed_at, user_id from trades.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, user_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "What completed_at, payment_status, first_name, display_name do we have for trades and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, user_id, users.first_name, users.display_name FROM tradingplatform.trades JOIN tradingplatform.users ON trades.user_id = users.id;", "sql": null}, {"role": "user", "content": "Group trades by seller_id and show the count of exchange_rate.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(exchange_rate) AS count_exchange_rate FROM tradingplatform.trades GROUP BY seller_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n total bigint NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n discount numeric NOT NULL,\n status text,\n payment_status character varying(128),\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n format character varying(256),\n visibility text,\n author_id varchar,\n text char NOT NULL,\n thumbnail character varying(64),\n reply_to_id char -- identifier for reply_to,\n trade_id integer -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.users (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n display_name character varying(128),\n first_name char,\n language character varying(64),\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Get all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve completed_at, discount, notification_id, joined_at showing the relationship between trades and users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.notification_id, users.joined_at FROM tradingplatform.trades JOIN tradingplatform.users ON trades.user_id = users.id;", "sql": null}, {"role": "user", "content": "Calculate sum of user_id for each total in trades.", "sql": null}, {"role": "assistant", "content": "SELECT total, SUM(user_id) AS sum_user_id FROM tradingplatform.trades GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "List published_at, video_url, popularity_score from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, video_url, popularity_score FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, video_url, popularity_score FROM gaming.inventory WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with branche_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, video_url, popularity_score FROM gaming.inventory WHERE published_at > '2023-01-01' ORDER BY branche_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Can you order these by popularity_score descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "Sort the results by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "List branche_id, published_at, video_url from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, published_at, video_url FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, published_at, video_url FROM gaming.inventory WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up inventory by popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(*) AS count FROM gaming.inventory GROUP BY popularity_score ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Order the output by popularity_score ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory ORDER BY popularity_score ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of popularity_score for each popularity_score in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, SUM(popularity_score) AS sum_popularity_score FROM gaming.inventory GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Order the output by popularity_score ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory ORDER BY popularity_score ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory ORDER BY popularity_score ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "List video_url, branche_id, published_at from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, branche_id, published_at FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, branche_id, published_at FROM gaming.inventory WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group inventory by branche_id and show the average of popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, AVERAGE(popularity_score) AS average_popularity_score FROM gaming.inventory GROUP BY branche_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Get branche_id, published_at, msrp from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, published_at, msrp FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, published_at, msrp FROM gaming.inventory WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different branche_id values.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, COUNT(*) AS count FROM gaming.inventory GROUP BY branche_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, video_url, published_at for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, video_url, published_at FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Get video_url, branche_id, category, timezone by joining inventory with branches.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, video_url, published_at, branches.category, branches.timezone FROM gaming.inventory JOIN gaming.branches ON inventory.branche_id = branches.location_id;", "sql": null}, {"role": "user", "content": "Calculate average of updated_at for each popularity_score in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, AVERAGE(updated_at) AS average_updated_at FROM gaming.inventory GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory WHERE popularity_score LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n msrp character varying(256),\n popularity_score character varying(128),\n video_url char -- identifier for video_url,\n branche_id integer -- reference to branches.location_id,\n FOREIGN KEY (branche_id) REFERENCES branches(location_id)\n)\n\nCREATE TABLE gaming.branches (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n category character varying(128),\n timezone character varying(256),\n latitude character varying(64) NOT NULL,\n parking_available varchar NOT NULL,\n accessibility character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by video_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.inventory WHERE video_url LIKE 'A%' ORDER BY video_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at timestamp without time zone,\n age character varying(256),\n is_verified bit NOT NULL -- indicates if verified is true,\n birth_date timestamp without time zone NOT NULL,\n membership_level text,\n password_hash varchar,\n username character varying(64),\n zip_code character varying(128)\n)\n\nCREATE TABLE education.teachers (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n shares character varying(64),\n user_id character varying(128),\n thumbnail char NOT NULL,\n message char NOT NULL,\n content character varying(64) NOT NULL,\n rating varchar\n)\n\nCREATE TABLE education.assignments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at date,\n reply_to_id character varying(128),\n message character varying(128),\n format character varying(64) NOT NULL,\n visibility varchar,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount decimal,\n seller_id character varying(128) NOT NULL,\n price decimal,\n total decimal NOT NULL,\n currency character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve format, updated_at, reply_to_id for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT format, updated_at, reply_to_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT format, updated_at, reply_to_id FROM education.assignments WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT format, updated_at, reply_to_id FROM education.assignments WHERE published_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at timestamp without time zone,\n age character varying(256),\n is_verified bit NOT NULL -- indicates if verified is true,\n birth_date timestamp without time zone NOT NULL,\n membership_level text,\n password_hash varchar,\n username character varying(64),\n zip_code character varying(128)\n)\n\nCREATE TABLE education.teachers (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n shares character varying(64),\n user_id character varying(128),\n thumbnail char NOT NULL,\n message char NOT NULL,\n content character varying(64) NOT NULL,\n rating varchar\n)\n\nCREATE TABLE education.assignments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at date,\n reply_to_id character varying(128),\n message character varying(128),\n format character varying(64) NOT NULL,\n visibility varchar,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount decimal,\n seller_id character varying(128) NOT NULL,\n price decimal,\n total decimal NOT NULL,\n currency character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by department_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE format LIKE 'A%' ORDER BY department_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at timestamp without time zone,\n age character varying(256),\n is_verified bit NOT NULL -- indicates if verified is true,\n birth_date timestamp without time zone NOT NULL,\n membership_level text,\n password_hash varchar,\n username character varying(64),\n zip_code character varying(128)\n)\n\nCREATE TABLE education.teachers (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n shares character varying(64),\n user_id character varying(128),\n thumbnail char NOT NULL,\n message char NOT NULL,\n content character varying(64) NOT NULL,\n rating varchar\n)\n\nCREATE TABLE education.assignments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at date,\n reply_to_id character varying(128),\n message character varying(128),\n format character varying(64) NOT NULL,\n visibility varchar,\n department_id text -- reference to departments.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(invoice_id)\n)\n\nCREATE TABLE education.departments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount decimal,\n seller_id character varying(128) NOT NULL,\n price decimal,\n total decimal NOT NULL,\n currency character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where message LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE message LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by message descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE message LIKE 'A%' ORDER BY message DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve description, updated_at, media_url for every review.", "sql": null}, {"role": "assistant", "content": "SELECT description, updated_at, media_url FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me description, media_url, created_at, media_url from reviews and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT description, updated_at, media_url, categories.created_at, categories.media_url FROM e-commerce.reviews JOIN e-commerce.categories ON reviews.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Order the output by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, updated_at, media_url, categories.created_at, categories.media_url FROM e-commerce.reviews JOIN e-commerce.categories ON reviews.categorie_id = categories.post_id ORDER BY media_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Calculate min of views for each media_url in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MIN(views) AS min_views FROM e-commerce.reviews GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve published_at, parent_id, media_url, thumbnail showing the relationship between reviews and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.media_url, categories.thumbnail FROM e-commerce.reviews JOIN e-commerce.categories ON reviews.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by parent_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.media_url, categories.thumbnail FROM e-commerce.reviews JOIN e-commerce.categories ON reviews.categorie_id = categories.post_id ORDER BY parent_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE description LIKE 'A%' ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me updated_at, categorie_id, parent_id for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, parent_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by visibility ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, categorie_id, parent_id FROM e-commerce.reviews ORDER BY visibility ASC;", "sql": null}, {"role": "user", "content": "Show me count of media_url grouped by categorie_id for reviews.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(media_url) AS count_media_url FROM e-commerce.reviews GROUP BY categorie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by views descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE published_at > '2023-12-01' ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the views, description, updated_at of each review?", "sql": null}, {"role": "assistant", "content": "SELECT views, description, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT views, description, updated_at FROM e-commerce.reviews WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate min of parent_id for each updated_at in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(parent_id) AS min_parent_id FROM e-commerce.reviews GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List published_at, description, media_url from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, media_url FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with visibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, media_url FROM e-commerce.reviews WHERE visibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, media_url FROM e-commerce.reviews WHERE visibility LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve parent_id, categorie_id, media_url for every review.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, categorie_id, media_url FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, categorie_id, media_url FROM e-commerce.reviews WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with views in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, categorie_id, media_url FROM e-commerce.reviews WHERE updated_at > '2023-01-01' ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id character varying(256),\n views text,\n media_url character varying(128),\n visibility character varying(128) NOT NULL,\n description char,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n visibility character varying(128),\n body character varying(64),\n media_url varchar NOT NULL,\n thumbnail character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group reviews by parent_id and show the average of visibility.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, AVERAGE(visibility) AS average_visibility FROM e-commerce.reviews GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "What are the brand, review_id, expires_at of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT brand, review_id, expires_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get all inventory created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT brand, review_id, expires_at FROM e-commerce.inventory WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT brand, review_id, expires_at FROM e-commerce.inventory WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "List review_id, created_at, coordinates from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, created_at, coordinates FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, created_at, coordinates FROM e-commerce.order_items ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, created_at, coordinates FROM e-commerce.order_items ORDER BY created_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "What order_item_id, edited_at, postal_code, review_id do we have for reviews and their associated order_items?", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.postal_code, order_items.review_id FROM e-commerce.reviews JOIN e-commerce.order_items ON reviews.order_item_id = order_items.id;", "sql": null}, {"role": "user", "content": "Can you order these by edited_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.postal_code, order_items.review_id FROM e-commerce.reviews JOIN e-commerce.order_items ON reviews.order_item_id = order_items.id ORDER BY edited_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "What review_id, coordinates, likes, order_item_id do we have for order_items and their associated reviews?", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.likes, reviews.order_item_id FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.likes, reviews.order_item_id FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get categories, shares, likes from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT categories, shares, likes FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT categories, shares, likes FROM e-commerce.reviews WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of likes by order_item_id from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, MAX(likes) AS max_likes FROM e-commerce.reviews GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up inventory by brand.", "sql": null}, {"role": "assistant", "content": "SELECT brand, COUNT(*) AS count FROM e-commerce.inventory GROUP BY brand ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "List coordinates, created_at, review_id from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, created_at, review_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items where postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, created_at, review_id FROM e-commerce.order_items WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by review_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, created_at, review_id FROM e-commerce.order_items WHERE postal_code LIKE 'A%' ORDER BY review_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "Show me all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Sort the results by msrp ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY msrp ASC;", "sql": null}, {"role": "user", "content": "Can you order these by popularity_score ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY popularity_score ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "What are the edited_at, image_url, shares of each review?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, image_url, shares FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, image_url, shares FROM e-commerce.reviews WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group reviews by edited_at and show the min of image_url.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, MIN(image_url) AS min_image_url FROM e-commerce.reviews GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n postal_code character varying(128),\n latitude char,\n coordinates varchar NOT NULL,\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n updated_at timestamp without time zone,\n msrp character varying(64),\n media_url character varying(256),\n views text,\n brand text,\n name varchar NOT NULL,\n popularity_score character varying(128),\n review_id text -- reference to reviews.id,\n FOREIGN KEY (review_id) REFERENCES reviews(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n categories varchar,\n shares text,\n likes varchar,\n order_item_id text -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)", "conversations": [{"role": "user", "content": "What are the latitude, review_id, created_at of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT latitude, review_id, created_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List postal_code, coordinates, categories, shares for each order_item along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, review_id, created_at, reviews.categories, reviews.shares FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.id;", "sql": null}, {"role": "user", "content": "Tally up order_items by review_id.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, COUNT(*) AS count FROM e-commerce.order_items GROUP BY review_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Show me nationality, avatar, password_hash for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, avatar, password_hash FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by bio descending.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, avatar, password_hash FROM healthcare.patients ORDER BY bio DESC;", "sql": null}, {"role": "user", "content": "Calculate min of bio for each medical_record_id in patients.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, MIN(bio) AS min_bio FROM healthcare.patients GROUP BY medical_record_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Get nationality, bio, last_name from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, bio, last_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me nationality, last_name, published_at, manufacturer from patients and their related medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, bio, last_name, medical_records.published_at, medical_records.manufacturer FROM healthcare.patients JOIN healthcare.medical_records ON patients.medical_record_id = medical_records.barcode;", "sql": null}, {"role": "user", "content": "Calculate average of nationality for each medical_record_id in patients.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, AVERAGE(nationality) AS average_nationality FROM healthcare.patients GROUP BY medical_record_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "What are the medical_record_id, bio, created_at of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, bio, created_at FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients with is_verified = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, bio, created_at FROM healthcare.patients WHERE is_verified = TRUE;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, bio, created_at FROM healthcare.patients WHERE is_verified = TRUE LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by password_hash ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY password_hash ASC;", "sql": null}, {"role": "user", "content": "Count the number of patients in each is_verified category.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, COUNT(*) AS count FROM healthcare.patients GROUP BY is_verified ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Sort the results by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY employee_id DESC;", "sql": null}, {"role": "user", "content": "Group patients by created_at and show the min of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(created_at) AS min_created_at FROM healthcare.patients GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Get last_name, avatar, employee_id from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, avatar, employee_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by api_key descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, avatar, employee_id FROM healthcare.patients ORDER BY api_key DESC;", "sql": null}, {"role": "user", "content": "Count the number of patients in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.patients GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "What are the employee_id, created_at, password_hash of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, created_at, password_hash FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, created_at, password_hash FROM healthcare.patients WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, created_at, password_hash FROM healthcare.patients WHERE created_at > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where password_hash LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE password_hash LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by avatar.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, COUNT(*) AS count FROM healthcare.patients GROUP BY avatar ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "List employee_id, nationality, password_hash from patients.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, nationality, password_hash FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List nationality, is_verified, tax_rate, updated_at for each patient along with their medical_record information.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, nationality, password_hash, medical_records.tax_rate, medical_records.updated_at FROM healthcare.patients JOIN healthcare.medical_records ON patients.medical_record_id = medical_records.barcode;", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by is_verified.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, COUNT(*) AS count FROM healthcare.patients GROUP BY is_verified ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes varchar NOT NULL,\n status character varying(64),\n reconciliation_status text,\n verification_status character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n last_active timestamp without time zone,\n is_verified bit -- indicates if verified is true,\n nationality character varying(128),\n password_hash varchar NOT NULL,\n api_key char,\n bio varchar,\n last_name character varying(64),\n avatar character varying(128),\n medical_record_id integer -- reference to medical_records.barcode,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(barcode)\n)\n\nCREATE TABLE healthcare.medical_records (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at timestamp without time zone,\n category character varying(64),\n tax_rate character varying(256),\n manufacturer varchar\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the count medical_record_id for each password_hash in patients?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(medical_record_id) AS count_medical_record_id FROM healthcare.patients GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE available LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Show me featured_rank, published_at, categorie_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, published_at, categorie_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, published_at, categorie_id FROM e-commerce.products ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, published_at, categorie_id FROM e-commerce.products ORDER BY popularity_score DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List published_at, expires_at, updated_at, timezone for each product along with their categorie information.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.updated_at, categories.timezone FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.person_id;", "sql": null}, {"role": "user", "content": "Show me count of popularity_score grouped by available for products.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(popularity_score) AS count_popularity_score FROM e-commerce.products GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Get id, expires_at, featured_rank from all products.", "sql": null}, {"role": "assistant", "content": "SELECT id, expires_at, featured_rank FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT id, expires_at, featured_rank FROM e-commerce.products ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Tally up products by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM e-commerce.products GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "List available, categorie_id, featured_rank from products.", "sql": null}, {"role": "assistant", "content": "SELECT available, categorie_id, featured_rank FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT available, categorie_id, featured_rank FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with popularity_score in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT available, categorie_id, featured_rank FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY popularity_score DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Get categorie_id, popularity_score, id from all products.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, popularity_score, id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, popularity_score, id FROM e-commerce.products WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, popularity_score, id FROM e-commerce.products WHERE published_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "Can you order these by categorie_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY categorie_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve expires_at, available, country, updated_at showing the relationship between products and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.country, categories.updated_at FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.person_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.country, categories.updated_at FROM e-commerce.products JOIN e-commerce.categories ON products.categorie_id = categories.person_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n email char,\n zip_code character varying(64),\n country character varying(256),\n timezone character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n popularity_score character varying(256),\n available varchar,\n featured_rank character varying(256) NOT NULL,\n categorie_id text -- reference to categories.person_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(person_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n image_url varchar,\n currency character varying(128) NOT NULL,\n name text\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of products across different available values.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM e-commerce.products GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get joined_at, birth_date, event_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, birth_date, event_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, birth_date, event_id FROM socialmedia.users WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me count of joined_at grouped by created_at for users.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(joined_at) AS count_joined_at FROM socialmedia.users GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by password_hash ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY password_hash ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different state values.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM socialmedia.users GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.users GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the sum state for each password_hash in users?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, SUM(state) AS sum_state FROM socialmedia.users GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, website, event_id for every user.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, website, event_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Order the output by birth_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, website, event_id FROM socialmedia.users ORDER BY birth_date ASC;", "sql": null}, {"role": "user", "content": "Calculate max of event_id for each state in users.", "sql": null}, {"role": "assistant", "content": "SELECT state, MAX(event_id) AS max_event_id FROM socialmedia.users GROUP BY state;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve website, state, avatar for every user.", "sql": null}, {"role": "assistant", "content": "SELECT website, state, avatar FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by website ascending.", "sql": null}, {"role": "assistant", "content": "SELECT website, state, avatar FROM socialmedia.users ORDER BY website ASC;", "sql": null}, {"role": "user", "content": "Sort the results by avatar ascending.", "sql": null}, {"role": "assistant", "content": "SELECT website, state, avatar FROM socialmedia.users ORDER BY avatar ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get birth_date, event_id, website from all users.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, event_id, website FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, event_id, website FROM socialmedia.users WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get max of birth_date by joined_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(birth_date) AS max_birth_date FROM socialmedia.users GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get joined_at, birth_date, event_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, birth_date, event_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get users that match password_hash LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, birth_date, event_id FROM socialmedia.users WHERE password_hash LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many users are there per event_id?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, COUNT(*) AS count FROM socialmedia.users GROUP BY event_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What nationality, password_hash, updated_at, payment_status do we have for users and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.payment_status FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.payment_id;", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by website for users.", "sql": null}, {"role": "assistant", "content": "SELECT website, MAX(created_at) AS max_created_at FROM socialmedia.users GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at date,\n password_hash character varying(64),\n nationality char,\n state character varying(128),\n birth_date date NOT NULL,\n website text NOT NULL,\n avatar character varying(64),\n event_id text -- reference to events.payment_id,\n FOREIGN KEY (event_id) REFERENCES events(payment_id)\n)\n\nCREATE TABLE socialmedia.events (\n payment_id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n updated_at date,\n card_type character varying(256),\n seller_id text -- identifier for seller,\n quantity text NOT NULL,\n total bigint NOT NULL,\n price numeric,\n payment_status character varying(64) NOT NULL,\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What state, password_hash, updated_at, delivery_status do we have for users and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.delivery_status FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.payment_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.delivery_status FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.payment_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "List user_id, approval_status, notes from investments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, notes FROM finance.investments;", "sql": null}, {"role": "user", "content": "List investments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, notes FROM finance.investments WHERE due_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by payee_id.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, COUNT(*) AS count FROM finance.investments GROUP BY payee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve payment_date, vendor_id, customer_id for every account.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, vendor_id, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, vendor_id, customer_id FROM finance.accounts WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group accounts by credit and show the count of customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT credit, COUNT(customer_id) AS count_customer_id FROM finance.accounts GROUP BY credit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "What is the sum created_at for each token in audits?", "sql": null}, {"role": "assistant", "content": "SELECT token, SUM(created_at) AS sum_created_at FROM finance.audits GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, approval_status, verification_status of each account?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, verification_status FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, verification_status FROM finance.accounts WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, verification_status FROM finance.accounts WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get all investments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of payment_date by payment_date from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, AVERAGE(payment_date) AS average_payment_date FROM finance.accounts GROUP BY payment_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where vendor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE vendor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up accounts by vendor_id.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM finance.accounts GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n credit character varying(128) NOT NULL,\n approval_status text NOT NULL,\n customer_id varchar NOT NULL,\n verification_status text NOT NULL,\n reference_number text,\n vendor_id character varying(64) NOT NULL -- identifier for vendor\n)\n\nCREATE TABLE finance.investments (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n approval_status character varying(256),\n payee_id text -- identifier for payee,\n notes character varying(64),\n vendor_id character varying(64) -- identifier for vendor,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE finance.audits (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at timestamp,\n token character varying(256),\n zip_code character varying(128),\n nationality character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve token, joined_at, created_at for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT token, joined_at, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT token, joined_at, created_at FROM finance.audits ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "How many audits are there per zip_code?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(*) AS count FROM finance.audits GROUP BY zip_code ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.addresses;", "sql": null}, {"role": "user", "content": "List addresses that have type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.addresses WHERE type LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average created_at for each type in addresses?", "sql": null}, {"role": "assistant", "content": "SELECT type, AVERAGE(created_at) AS average_created_at FROM events.addresses GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts WHERE processed_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods;", "sql": null}, {"role": "user", "content": "Can you order these by name descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY name DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me tax_rate, published_at, views for all goods.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, published_at, views FROM events.goods;", "sql": null}, {"role": "user", "content": "Get goods that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, published_at, views FROM events.goods WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of goods grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM events.goods GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.addresses;", "sql": null}, {"role": "user", "content": "Order the output by location_lon descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.addresses ORDER BY location_lon DESC;", "sql": null}, {"role": "user", "content": "What is the sum postal_code for each location_lon in addresses?", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, SUM(postal_code) AS sum_postal_code FROM events.addresses GROUP BY location_lon;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts;", "sql": null}, {"role": "user", "content": "List accounts with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show the results sorted by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.accounts WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY payee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods;", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY media_url DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY media_url DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n type character varying(256),\n location_lon char,\n postal_code character varying(64) NOT NULL,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.goods (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n description character varying(128),\n media_url varchar NOT NULL,\n tax_rate character varying(128),\n name varchar NOT NULL,\n views varchar NOT NULL,\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE events.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n vendor_id varchar NOT NULL,\n reference_number varchar,\n exchange_rate varchar,\n invoice_number varchar,\n approval_status character varying(256),\n currency text,\n payee_id char -- identifier for payee,\n good_id integer NOT NULL -- reference to goods.id,\n FOREIGN KEY (good_id) REFERENCES goods(id)\n)\n\nCREATE TABLE events.members (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n gender character varying(128),\n city text,\n language text,\n zip_code character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods;", "sql": null}, {"role": "user", "content": "Show the results sorted by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.goods ORDER BY name DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of followers in each title category.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM socialmedia.followers GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY title DESC;", "sql": null}, {"role": "user", "content": "Calculate count of attachment_url for each edited_at in followers.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(attachment_url) AS count_attachment_url FROM socialmedia.followers GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "Retrieve edited_at, title, attachment_url for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, title, attachment_url FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by format descending?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, title, attachment_url FROM socialmedia.followers ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Group followers by edited_at and show the count of edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(edited_at) AS count_edited_at FROM socialmedia.followers GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "List views, group_id, title from followers.", "sql": null}, {"role": "assistant", "content": "SELECT views, group_id, title FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT views, group_id, title FROM socialmedia.followers ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Group followers by group_id and show the sum of edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, SUM(edited_at) AS sum_edited_at FROM socialmedia.followers GROUP BY group_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "What are the group_id, user_id, title of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, title FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, title FROM socialmedia.followers ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, title FROM socialmedia.followers ORDER BY user_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE views LIKE 'A%' ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "List user_id, views, group_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, views, group_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get all followers created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, views, group_id FROM socialmedia.followers WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group followers by group_id and show the sum of group_id.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, SUM(group_id) AS sum_group_id FROM socialmedia.followers GROUP BY group_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of followers grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n views character varying(128),\n title text,\n attachment_url text NOT NULL,\n image_url character varying(64),\n format character varying(64),\n user_id char -- identifier for user,\n group_id text NOT NULL -- reference to groups.content_id,\n FOREIGN KEY (group_id) REFERENCES groups(content_id)\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n available text,\n cost decimal,\n backorder varchar NOT NULL,\n name text,\n description varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n shares char,\n rating text,\n media_url character varying(64),\n keywords text NOT NULL,\n content character varying(64),\n author_id character varying(64)\n)\n\nCREATE TABLE socialmedia.groups (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n user_id character varying(256),\n likes varchar NOT NULL,\n views character varying(64) NOT NULL,\n reply_to_id varchar\n)", "conversations": [{"role": "user", "content": "What are the title, views, image_url of each follower?", "sql": null}, {"role": "assistant", "content": "SELECT title, views, image_url FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve attachment_url, image_url, published_at, user_id showing the relationship between followers and groups.", "sql": null}, {"role": "assistant", "content": "SELECT title, views, image_url, groups.published_at, groups.user_id FROM socialmedia.followers JOIN socialmedia.groups ON followers.group_id = groups.content_id;", "sql": null}, {"role": "user", "content": "Calculate count of views for each user_id in followers.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(views) AS count_views FROM socialmedia.followers GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me balance, credit, category for all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT balance, credit, category FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Sort the results by payment_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT balance, credit, category FROM tradingplatform.wallets ORDER BY payment_date ASC;", "sql": null}, {"role": "user", "content": "Tally up wallets by verification_status.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me exchange_rate, verification_status, reconciliation_status for all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, verification_status, reconciliation_status FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, verification_status, reconciliation_status FROM tradingplatform.wallets WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, verification_status, reconciliation_status FROM tradingplatform.wallets WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "List credit, processed_at, log_id from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT credit, processed_at, log_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Can you order these by category ascending?", "sql": null}, {"role": "assistant", "content": "SELECT credit, processed_at, log_id FROM tradingplatform.wallets ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with reconciliation_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT credit, processed_at, log_id FROM tradingplatform.wallets ORDER BY reconciliation_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Retrieve log_id, verification_status, credit for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, verification_status, credit FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, verification_status, credit FROM tradingplatform.wallets ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Show me max of category grouped by balance for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT balance, MAX(category) AS max_category FROM tradingplatform.wallets GROUP BY balance;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Get balance, processed_at, verification_status from all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT balance, processed_at, verification_status FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT balance, processed_at, verification_status FROM tradingplatform.wallets WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many wallets are there per log_id?", "sql": null}, {"role": "assistant", "content": "SELECT log_id, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY log_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE category LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of trades in each product_id category.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM tradingplatform.trades GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Retrieve verification_status, reconciliation_status, log_id for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, reconciliation_status, log_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, reconciliation_status, log_id FROM tradingplatform.wallets WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many wallets are there per processed_at?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets that have category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up wallets by exchange_rate.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date date,\n credit character varying(256) NOT NULL,\n reconciliation_status character varying(128),\n category char,\n exchange_rate character varying(256),\n balance bigint,\n verification_status character varying(64) NOT NULL,\n log_id text -- reference to logs.customer_id,\n FOREIGN KEY (log_id) REFERENCES logs(customer_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n payment_method character varying(64),\n product_id character varying(128) NOT NULL -- identifier for product,\n exchange_rate character varying(128) NOT NULL,\n status character varying(64),\n quantity char NOT NULL,\n seller_id varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n timezone character varying(256),\n account_status char NOT NULL,\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Retrieve all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get payment_date, log_id, timezone, is_verified by joining wallets with logs.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.timezone, logs.is_verified FROM tradingplatform.wallets JOIN tradingplatform.logs ON wallets.log_id = logs.customer_id;", "sql": null}, {"role": "user", "content": "Count the number of wallets in each log_id category.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY log_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me updated_at, prescription_id, featured_rank, quantity from medical_records and their related prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.featured_rank, prescriptions.quantity FROM healthcare.medical_records JOIN healthcare.prescriptions ON medical_records.prescription_id = prescriptions.sku;", "sql": null}, {"role": "user", "content": "What is the min approval_status for each updated_at in medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(approval_status) AS min_approval_status FROM healthcare.medical_records GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records with prescription_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE prescription_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE prescription_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List updated_at, approval_status, payment_method from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, payment_method FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_method in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, payment_method FROM healthcare.medical_records ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, payment_method FROM healthcare.medical_records ORDER BY payment_method ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the featured_rank, image_url, subcategory of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, image_url, subcategory FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Sort the results by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, image_url, subcategory FROM healthcare.prescriptions ORDER BY featured_rank DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different quantity values.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve prescription_id, updated_at, payment_method for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, updated_at, payment_method FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, updated_at, payment_method FROM healthcare.medical_records WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate max of updated_at for each prescription_id in medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, MAX(updated_at) AS max_updated_at FROM healthcare.medical_records GROUP BY prescription_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List featured_rank, updated_at, quantity from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, quantity FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by patient_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, quantity FROM healthcare.prescriptions ORDER BY patient_id ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, quantity FROM healthcare.prescriptions ORDER BY patient_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List subcategory, updated_at, quantity from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, updated_at, quantity FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, updated_at, quantity FROM healthcare.prescriptions ORDER BY subcategory DESC;", "sql": null}, {"role": "user", "content": "Get average of quantity by image_url from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, AVERAGE(quantity) AS average_quantity FROM healthcare.prescriptions GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get all medical_records created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group medical_records by approval_status and show the sum of payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(payment_method) AS sum_payment_method FROM healthcare.medical_records GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n approval_status character varying(256) NOT NULL,\n payment_method varchar NOT NULL,\n prescription_id text -- reference to prescriptions.sku,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(sku)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n username varchar,\n last_login timestamp without time zone,\n city character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.prescriptions (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank text,\n image_url character varying(256) NOT NULL,\n quantity char,\n subcategory text,\n patient_id integer -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(128),\n user_id character varying(64) NOT NULL -- identifier for user,\n score char,\n author_id character varying(128)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY approval_status DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve language, last_active, joined_at for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, joined_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items where last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, joined_at FROM e-commerce.order_items WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT language, last_active, joined_at FROM e-commerce.order_items WHERE last_login > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve avatar, display_name, email for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, email FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items that have review_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, email FROM e-commerce.order_items WHERE review_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, display_name, email FROM e-commerce.order_items WHERE review_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve language, avatar, image_url, created_at showing the relationship between order_items and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.image_url, reviews.created_at FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "What is the average review_id for each last_login in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, AVERAGE(review_id) AS average_review_id FROM e-commerce.order_items GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "List last_login, review_id, language from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, review_id, language FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, review_id, language FROM e-commerce.order_items WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, review_id, language FROM e-commerce.order_items WHERE joined_at > '2023-01-01' ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me last_active, avatar, display_name for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, avatar, display_name FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, avatar, display_name FROM e-commerce.order_items WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate count of password_hash for each language in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(password_hash) AS count_password_hash FROM e-commerce.order_items GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with avatar in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY avatar ASC;", "sql": null}, {"role": "user", "content": "Sort the results by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "List last_active, last_login, avatar from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_login, avatar FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me last_login, avatar, created_at, author_id from order_items and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_login, avatar, reviews.created_at, reviews.author_id FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "Calculate count of last_active for each display_name in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(last_active) AS count_last_active FROM e-commerce.order_items GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "List last_login, joined_at, last_active from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, joined_at, last_active FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "What avatar, review_id, author_id, edited_at do we have for order_items and their associated reviews?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, joined_at, last_active, reviews.author_id, reviews.edited_at FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "What is the min last_login for each avatar in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT avatar, MIN(last_login) AS min_last_login FROM e-commerce.order_items GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me joined_at, review_id, author_id, visibility from order_items and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.author_id, reviews.visibility FROM e-commerce.order_items JOIN e-commerce.reviews ON order_items.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "What is the average password_hash for each email in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT email, AVERAGE(password_hash) AS average_password_hash FROM e-commerce.order_items GROUP BY email;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n joined_at date,\n avatar character varying(256),\n password_hash varchar NOT NULL,\n language character varying(64),\n display_name character varying(256),\n email character varying(64),\n last_login date,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE e-commerce.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n visibility character varying(128),\n views char,\n image_url char,\n author_id char -- identifier for author\n)\n\nCREATE TABLE e-commerce.categories (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n subject char NOT NULL,\n tags char,\n reply_to_id character varying(64),\n shares text NOT NULL,\n rating character varying(256),\n description varchar,\n likes text NOT NULL\n)", "conversations": [{"role": "user", "content": "List last_login, password_hash, email from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, password_hash, email FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items that have language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, password_hash, email FROM e-commerce.order_items WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of order_items in each password_hash category.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM e-commerce.order_items GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations;", "sql": null}, {"role": "user", "content": "Show me locations with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group locations by street and show the max of street.", "sql": null}, {"role": "assistant", "content": "SELECT street, MAX(street) AS max_street FROM logistics.locations GROUP BY street;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions;", "sql": null}, {"role": "user", "content": "Retrieve subscriptions where payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the max processed_at for each customer_id in subscriptions?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(processed_at) AS max_processed_at FROM logistics.subscriptions GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions;", "sql": null}, {"role": "user", "content": "Find subscriptions created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions WHERE payment_date >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many subscriptions are there per reconciliation_status?", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, COUNT(*) AS count FROM logistics.subscriptions GROUP BY reconciliation_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations;", "sql": null}, {"role": "user", "content": "Find locations created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different timezone values.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM logistics.locations GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations;", "sql": null}, {"role": "user", "content": "Get all locations between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of locations grouped by street.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM logistics.locations GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve address_line2, timezone, street for every location.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, timezone, street FROM logistics.locations;", "sql": null}, {"role": "user", "content": "List locations with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, timezone, street FROM logistics.locations WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get average of zip_code by description from locations.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(zip_code) AS average_zip_code FROM logistics.locations GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions;", "sql": null}, {"role": "user", "content": "Find subscriptions from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.locations;", "sql": null}, {"role": "user", "content": "What created_at, review_id, visibility, rating do we have for locations and their associated reviews?", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.visibility, reviews.rating FROM logistics.locations JOIN logistics.reviews ON locations.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.visibility, reviews.rating FROM logistics.locations JOIN logistics.reviews ON locations.review_id = reviews.message_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.subscriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n processed_at timestamp,\n reconciliation_status char,\n user_id text NOT NULL,\n verification_status character varying(64) NOT NULL,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE logistics.locations (\n venue_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n address_line2 character varying(64),\n street character varying(256),\n description character varying(256),\n zip_code text NOT NULL,\n timezone varchar,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE logistics.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp without time zone,\n language character varying(128) NOT NULL,\n display_name text,\n phone char,\n bio char,\n token text,\n is_verified boolean\n)\n\nCREATE TABLE logistics.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n text text NOT NULL,\n attachment_url char,\n rating character varying(128),\n visibility character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions;", "sql": null}, {"role": "user", "content": "Get subscriptions that match payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.subscriptions WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of processed_at grouped by reconciliation_status for subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, AVERAGE(processed_at) AS average_processed_at FROM logistics.subscriptions GROUP BY reconciliation_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions;", "sql": null}, {"role": "user", "content": "Find transactions modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get min of payment_status by customer_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MIN(payment_status) AS min_payment_status FROM media.transactions GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me max of approval_status grouped by tax for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT tax, MAX(approval_status) AS max_approval_status FROM media.transactions GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of buyer_id grouped by currency for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, AVERAGE(buyer_id) AS average_buyer_id FROM media.transactions GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, customer_id, buyer_id of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, customer_id, buyer_id FROM media.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, customer_id, buyer_id FROM media.transactions WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group transactions by buyer_id and show the min of tax.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, MIN(tax) AS min_tax FROM media.transactions GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve traded_at, review_id, subtotal for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, review_id, subtotal FROM media.transactions;", "sql": null}, {"role": "user", "content": "Find transactions where tax > 9.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, review_id, subtotal FROM media.transactions WHERE tax > 9;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, review_id, subtotal FROM media.transactions WHERE tax > 9 ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions;", "sql": null}, {"role": "user", "content": "Show me payment_status, updated_at, score, categories from transactions and their related reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.score, reviews.categories FROM media.transactions JOIN media.reviews ON transactions.review_id = reviews.message_id;", "sql": null}, {"role": "user", "content": "Tally up transactions by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM media.transactions GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List approval_status, payment_status, review_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_status, review_id FROM media.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_status, review_id FROM media.transactions WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the count review_id for each traded_at in transactions?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, COUNT(review_id) AS count_review_id FROM media.transactions GROUP BY traded_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "What are the currency, customer_id, tax of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT currency, customer_id, tax FROM media.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, customer_id, tax FROM media.transactions WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different review_id values.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, COUNT(*) AS count FROM media.transactions GROUP BY review_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.transactions ORDER BY payment_status ASC;", "sql": null}, {"role": "user", "content": "Tally up transactions by traded_at.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, COUNT(*) AS count FROM media.transactions GROUP BY traded_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n edited_at timestamp without time zone,\n reply_to_id character varying(64),\n score character varying(256) NOT NULL,\n parent_id character varying(64) NOT NULL,\n categories text,\n format char\n)\n\nCREATE TABLE media.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n traded_at timestamp without time zone,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n customer_id character varying(64),\n approval_status char NOT NULL,\n payment_status character varying(64),\n subtotal bigint,\n currency character varying(128),\n tax numeric,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me review_id, customer_id, updated_at for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, customer_id, updated_at FROM media.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where tax > 36.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, customer_id, updated_at FROM media.transactions WHERE tax > 36;", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different subtotal values.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM media.transactions GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, customer_id, payment_method for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, customer_id, payment_method FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, customer_id, payment_method FROM finance.payments WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by tax descending?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, customer_id, payment_method FROM finance.payments WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY tax DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Get buyer_id, currency, payment_method from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, payment_method FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, payment_method FROM finance.payments WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, payment_method FROM finance.payments WHERE traded_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Get count of order_id by order_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(order_id) AS count_order_id FROM finance.payments GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List order_id, currency, display_name, birth_date for each payment along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.display_name, customers.birth_date FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by traded_at.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, COUNT(*) AS count FROM finance.payments GROUP BY traded_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by approval_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, payment_method, order_id for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_method, order_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_method, order_id FROM finance.payments WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, payment_method, order_id FROM finance.payments WHERE traded_at > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments with currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE currency LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get traded_at, quantity, birth_date, salt by joining payments with customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.birth_date, customers.salt FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.birth_date, customers.salt FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.employee_id ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "List approval_status, payment_method, quantity from payments.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_method, quantity FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_method, quantity FROM finance.payments WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, payment_method, quantity FROM finance.payments WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n tax smallint NOT NULL,\n payment_method character varying(256),\n currency character varying(64),\n buyer_id text,\n approval_status text,\n quantity varchar,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n status character varying(256),\n currency varchar,\n customer_id character varying(256) -- identifier for customer,\n notes character varying(256),\n verification_status char NOT NULL,\n invoice_number character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n display_name char NOT NULL,\n salt text NOT NULL,\n birth_date timestamp without time zone NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve traded_at, currency, tax for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, currency, tax FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by tax ascending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, currency, tax FROM finance.payments ORDER BY tax ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.payments GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders where price > 57.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE price > 57;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE price > 57 ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me user_id, traded_at, quantity for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, quantity FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get orders that match account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, quantity FROM tradingplatform.orders WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, quantity FROM tradingplatform.orders WHERE account_id LIKE 'A%' ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "List cancelled_at, traded_at, user_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, traded_at, user_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, traded_at, user_id FROM tradingplatform.orders WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, traded_at, user_id FROM tradingplatform.orders WHERE traded_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with price in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY price DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY price DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "List due_date, user_id, approval_status from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, user_id, approval_status FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "What invoice_id, due_date, is_verified, is_active do we have for wallets and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, user_id, approval_status, users.is_verified, users.is_active FROM tradingplatform.wallets JOIN tradingplatform.users ON wallets.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, user_id, approval_status, users.is_verified, users.is_active FROM tradingplatform.wallets JOIN tradingplatform.users ON wallets.user_id = users.user_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "What are the traded_at, price, account_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, price, account_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders with traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, price, account_id FROM tradingplatform.orders WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get max of price by payment_status from orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, MAX(price) AS max_price FROM tradingplatform.orders GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me order_id, payment_date, description for all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, payment_date, description FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get order_id, description, is_active, joined_at by joining wallets with users.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, payment_date, description, users.is_active, users.joined_at FROM tradingplatform.wallets JOIN tradingplatform.users ON wallets.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Can you order these by description ascending?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, payment_date, description, users.is_active, users.joined_at FROM tradingplatform.wallets JOIN tradingplatform.users ON wallets.user_id = users.user_id ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Show me order_id, approval_status, user_id for all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, user_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, user_id FROM tradingplatform.wallets ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, approval_status, user_id FROM tradingplatform.wallets ORDER BY user_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "What are the cancelled_at, price, account_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, price, account_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, price, account_id FROM tradingplatform.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, price, account_id FROM tradingplatform.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp,\n payment_date timestamp without time zone,\n description character varying(256),\n approval_status varchar,\n user_id text -- reference to users.user_id,\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n account_id text -- identifier for account,\n payment_status character varying(256),\n price bigint,\n quantity character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active date,\n is_active bit NOT NULL,\n status char,\n display_name character varying(256) NOT NULL,\n website character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true\n)", "conversations": [{"role": "user", "content": "Get description, order_id, invoice_id from all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT description, order_id, invoice_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show the results sorted by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, order_id, invoice_id FROM tradingplatform.wallets ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Show me the count of wallets grouped by payment_date.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY payment_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of assignments across different subtotal values.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM education.assignments GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Show me customer_id, approval_status, seller_id for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, seller_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, seller_id FROM education.teachers WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, approval_status, seller_id FROM education.teachers WHERE created_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Show me address_line2, capacity, store_id for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, capacity, store_id FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me courses with accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, capacity, store_id FROM education.courses WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count state for each address_line2 in courses?", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, COUNT(state) AS count_state FROM education.courses GROUP BY address_line2;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "List currency, approval_status, delivery_status from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, delivery_status FROM education.teachers;", "sql": null}, {"role": "user", "content": "Order the output by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, delivery_status FROM education.teachers ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, delivery_status FROM education.teachers ORDER BY delivery_status DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Show me currency, approval_status, seller_id for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, seller_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers where seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, seller_id FROM education.teachers WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of teachers across different delivery_status values.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM education.teachers GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by completed_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of teachers across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.teachers GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Retrieve courses where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get count of accessibility by state from courses.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(accessibility) AS count_accessibility FROM education.courses GROUP BY state;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get all courses modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of courses grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.courses GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "What are the currency, completed_at, seller_id of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT currency, completed_at, seller_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT currency, completed_at, seller_id FROM education.teachers WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of teachers in each seller_id category.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM education.teachers GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n completed_at date,\n delivery_status character varying(256),\n seller_id character varying(256) -- identifier for seller,\n currency character varying(128),\n approval_status char,\n customer_id character varying(128)\n)\n\nCREATE TABLE education.courses (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128) NOT NULL,\n latitude character varying(256) NOT NULL,\n address_line2 text NOT NULL,\n category character varying(256) NOT NULL,\n state text NOT NULL,\n capacity text,\n accessibility character varying(128) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n order_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp without time zone,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n subtotal integer,\n approval_status char NOT NULL,\n account_id varchar -- identifier for account,\n payment_method varchar\n)", "conversations": [{"role": "user", "content": "What are the state, capacity, accessibility of each course?", "sql": null}, {"role": "assistant", "content": "SELECT state, capacity, accessibility FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by city descending.", "sql": null}, {"role": "assistant", "content": "SELECT state, capacity, accessibility FROM education.courses ORDER BY city DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of courses across different store_id values.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(*) AS count FROM education.courses GROUP BY store_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get trades that match notification_id > 61.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE notification_id > 61;", "sql": null}, {"role": "user", "content": "Get min of notification_id by delivery_status from trades.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, MIN(notification_id) AS min_notification_id FROM tradingplatform.trades GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE manufacturer LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE user_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Get notification_id, delivery_status, completed_at from all trades.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, delivery_status, completed_at FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve completed_at, notification_id, metadat_id, manufacturer showing the relationship between trades and notifications.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, delivery_status, completed_at, notifications.metadat_id, notifications.manufacturer FROM tradingplatform.trades JOIN tradingplatform.notifications ON trades.notification_id = notifications.barcode;", "sql": null}, {"role": "user", "content": "Group trades by completed_at and show the max of notification_id.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, MAX(notification_id) AS max_notification_id FROM tradingplatform.trades GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Order the output by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Show me the count of notifications grouped by manufacturer.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY manufacturer ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show me trades that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate min of delivery_status for each notification_id in trades.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, MIN(delivery_status) AS min_delivery_status FROM tradingplatform.trades GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Show me completed_at, delivery_status, quantity for all trades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, delivery_status, quantity FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show the results sorted by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, delivery_status, quantity FROM tradingplatform.trades ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, delivery_status, quantity FROM tradingplatform.trades ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get notifications that match manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of notifications grouped by metadat_id.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY metadat_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url varchar,\n manufacturer char,\n metadat_id integer NOT NULL -- reference to metadata.product_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(product_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n popularity_score character varying(256),\n backorder character varying(256),\n thumbnail_url varchar,\n reserved character varying(256),\n views character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n user_id character varying(64) NOT NULL,\n approval_status text,\n delivery_status character varying(256),\n quantity text,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)", "conversations": [{"role": "user", "content": "Get image_url, manufacturer, published_at from all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, manufacturer, published_at FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, manufacturer, published_at FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, manufacturer, published_at FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "List event_id, parent_id, visibility from messages.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, parent_id, visibility FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, parent_id, visibility FROM socialmedia.messages WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "What is the count views for each user_id in messages?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(views) AS count_views FROM socialmedia.messages GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Retrieve parent_id, keywords, updated_at for every message.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, keywords, updated_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by keywords descending.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, keywords, updated_at FROM socialmedia.messages ORDER BY keywords DESC;", "sql": null}, {"role": "user", "content": "Tally up messages by keywords.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, COUNT(*) AS count FROM socialmedia.messages GROUP BY keywords ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Get user_id, keywords, updated_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, keywords, updated_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, keywords, updated_at FROM socialmedia.messages WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up messages by keywords.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, COUNT(*) AS count FROM socialmedia.messages GROUP BY keywords ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by address_line1 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY address_line1 ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY address_line1 ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Get created_at, name, latitude from all events.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, name, latitude FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, name, latitude FROM socialmedia.events WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of events grouped by latitude.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, COUNT(*) AS count FROM socialmedia.events GROUP BY latitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Retrieve parent_id, thumbnail, updated_at for every message.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, thumbnail, updated_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by parent_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, thumbnail, updated_at FROM socialmedia.messages ORDER BY parent_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, thumbnail, updated_at FROM socialmedia.messages ORDER BY parent_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "What are the message_id, created_at, address_line1 of each event?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, created_at, address_line1 FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by message_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, created_at, address_line1 FROM socialmedia.events ORDER BY message_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, created_at, address_line1 FROM socialmedia.events ORDER BY message_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "List updated_at, views, user_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, views, user_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, views, user_id FROM socialmedia.messages WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, views, user_id FROM socialmedia.messages WHERE views LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Get geo_point, longitude, latitude from all events.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, longitude, latitude FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events with address_line1 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, longitude, latitude FROM socialmedia.events WHERE address_line1 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by longitude ascending?", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, longitude, latitude FROM socialmedia.events WHERE address_line1 LIKE 'A%' ORDER BY longitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n views char NOT NULL,\n visibility character varying(128),\n thumbnail varchar,\n user_id char,\n keywords character varying(128) NOT NULL,\n parent_id character varying(128),\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n geo_point char,\n longitude character varying(128),\n latitude char,\n address_line1 char NOT NULL,\n name character varying(64),\n message_id text NOT NULL -- reference to messages.id,\n FOREIGN KEY (message_id) REFERENCES messages(id)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where keywords LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE keywords LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE keywords LIKE 'A%' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "List categories, reply_to_id, trade_id from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT categories, reply_to_id, trade_id FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT categories, reply_to_id, trade_id FROM tradingplatform.notifications WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get count of categories by attachment_url from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, COUNT(categories) AS count_categories FROM tradingplatform.notifications GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of notifications grouped by parent_id.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY parent_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with reply_to_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE media_url LIKE 'A%' ORDER BY reply_to_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE media_url LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Show me reply_to_id, user_id, categories for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, user_id, categories FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, user_id, categories FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, user_id, categories FROM tradingplatform.notifications WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by categories ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY categories ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve published_at, id, fee, subtotal showing the relationship between notifications and trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.fee, trades.subtotal FROM tradingplatform.notifications JOIN tradingplatform.trades ON notifications.trade_id = trades.id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.fee, trades.subtotal FROM tradingplatform.notifications JOIN tradingplatform.trades ON notifications.trade_id = trades.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Get published_at, user_id, attachment_url from all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, user_id, attachment_url FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, user_id, attachment_url FROM tradingplatform.notifications WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, user_id, attachment_url FROM tradingplatform.notifications WHERE trade_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Get all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the max parent_id for each media_url in notifications?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MAX(parent_id) AS max_parent_id FROM tradingplatform.notifications GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n reply_to_id text,\n user_id character varying(256),\n attachment_url character varying(256),\n media_url character varying(128),\n categories varchar NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent,\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n seller_id text NOT NULL -- identifier for seller,\n delivery_status char,\n quantity character varying(64) NOT NULL,\n subtotal smallint,\n fee character varying(64),\n account_id character varying(128) -- identifier for account\n)", "conversations": [{"role": "user", "content": "Get all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with parent_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE parent_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by trade_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE parent_id LIKE 'A%' ORDER BY trade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Get location_lat, timezone, location_lon from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, timezone, location_lon FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where enrollment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, timezone, location_lon FROM education.departments WHERE enrollment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, timezone, location_lon FROM education.departments WHERE enrollment_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Get location_lon, timezone, location_lat from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, timezone, location_lat FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, timezone, location_lat FROM education.departments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, timezone, location_lat FROM education.departments WHERE created_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Retrieve enrollment_id, subject, tags for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, subject, tags FROM education.grades;", "sql": null}, {"role": "user", "content": "What thumbnail, tags, type, latitude do we have for grades and their associated enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, subject, tags, enrollments.type, enrollments.latitude FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.location_id;", "sql": null}, {"role": "user", "content": "Count the number of grades in each subject category.", "sql": null}, {"role": "assistant", "content": "SELECT subject, COUNT(*) AS count FROM education.grades GROUP BY subject ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "What are the media_url, enrollment_id, published_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, enrollment_id, published_at FROM education.grades;", "sql": null}, {"role": "user", "content": "List published_at, likes, accessibility, name for each grade along with their enrollment information.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, enrollment_id, published_at, enrollments.accessibility, enrollments.name FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.location_id;", "sql": null}, {"role": "user", "content": "How many grades are there per enrollment_id?", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, COUNT(*) AS count FROM education.grades GROUP BY enrollment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different geo_point values.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM education.departments GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Get subject, likes, enrollment_id from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT subject, likes, enrollment_id FROM education.grades;", "sql": null}, {"role": "user", "content": "What published_at, likes, last_inspected, updated_at do we have for grades and their associated enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT subject, likes, enrollment_id, enrollments.last_inspected, enrollments.updated_at FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.location_id;", "sql": null}, {"role": "user", "content": "Arrange the results with subject in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT subject, likes, enrollment_id, enrollments.last_inspected, enrollments.updated_at FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.location_id ORDER BY subject DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Show me location_lat, operating_hours, enrollment_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, operating_hours, enrollment_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve description, geo_point, last_inspected, latitude showing the relationship between departments and enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, operating_hours, enrollment_id, enrollments.last_inspected, enrollments.latitude FROM education.departments JOIN education.enrollments ON departments.enrollment_id = enrollments.location_id;", "sql": null}, {"role": "user", "content": "Show me min of created_at grouped by geo_point for departments.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, MIN(created_at) AS min_created_at FROM education.departments GROUP BY geo_point;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different timezone values.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM education.departments GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by operating_hours descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY operating_hours DESC;", "sql": null}, {"role": "user", "content": "Count the number of departments in each timezone category.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM education.departments GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n content_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n likes varchar,\n subject character varying(64),\n tags char,\n media_url character varying(256) NOT NULL,\n thumbnail character varying(64),\n enrollment_id text NOT NULL -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.departments (\n venue_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n geo_point character varying(256),\n timezone character varying(256) NOT NULL,\n operating_hours character varying(64) NOT NULL,\n location_lat varchar,\n description character varying(256),\n location_lon varchar,\n enrollment_id text -- reference to enrollments.location_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(location_id)\n)\n\nCREATE TABLE education.enrollments (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n type character varying(64),\n latitude character varying(64) NOT NULL,\n name character varying(256),\n accessibility char\n)", "conversations": [{"role": "user", "content": "Get geo_point, operating_hours, timezone from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, operating_hours, timezone FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, operating_hours, timezone FROM education.departments WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, operating_hours, timezone FROM education.departments WHERE geo_point LIKE 'A%' ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, prescription_id, department_id for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, prescription_id, department_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors that have category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, prescription_id, department_id FROM healthcare.doctors WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, prescription_id, department_id FROM healthcare.doctors WHERE category LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Sort the results by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY category DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get operating_hours, parking_available, quantity, name by joining doctors with departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.quantity, departments.name FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku;", "sql": null}, {"role": "user", "content": "Arrange the results with last_inspected in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.quantity, departments.name FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Get operating_hours, venue_id, last_inspected from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, venue_id, last_inspected FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve parking_available, venue_id, image_url, created_at showing the relationship between doctors and departments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, venue_id, last_inspected, departments.image_url, departments.created_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, venue_id, last_inspected, departments.image_url, departments.created_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me location_lon, updated_at, backorder, created_at from doctors and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.backorder, departments.created_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.backorder, departments.created_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "List category, department_id, parking_available from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT category, department_id, parking_available FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with last_inspected in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, department_id, parking_available FROM healthcare.doctors ORDER BY last_inspected ASC;", "sql": null}, {"role": "user", "content": "How many doctors are there per location_lon?", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, COUNT(*) AS count FROM healthcare.doctors GROUP BY location_lon ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max latitude for each category in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(latitude) AS max_latitude FROM healthcare.doctors GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "Show me latitude, parking_available, category for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, parking_available, category FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get operating_hours, updated_at, quantity, discount by joining doctors with departments.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, parking_available, category, departments.quantity, departments.discount FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku;", "sql": null}, {"role": "user", "content": "Get the distribution of doctors across different category values.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM healthcare.doctors GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n sku text PRIMARY KEY -- unique identifier,\n created_at date,\n image_url char,\n title character varying(256),\n name character varying(64) NOT NULL,\n featured_rank character varying(256),\n quantity char NOT NULL,\n backorder character varying(256),\n discount numeric\n)\n\nCREATE TABLE healthcare.doctors (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours varchar,\n parking_available text,\n latitude char,\n location_lon varchar,\n category varchar,\n department_id text -- reference to departments.sku,\n prescription_id integer -- reference to prescriptions.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(sku),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(product_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n discount bigint NOT NULL,\n rating character varying(64),\n popularity_score char\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "What latitude, prescription_id, backorder, created_at do we have for doctors and their associated departments?", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.backorder, departments.created_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.sku;", "sql": null}, {"role": "user", "content": "Get max of last_inspected by last_inspected from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, MAX(last_inspected) AS max_last_inspected FROM healthcare.doctors GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, currency, audit_id for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, audit_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get traded_at, account_id, amount, currency by joining transactions with audits.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, audit_id, audits.amount, audits.currency FROM finance.transactions JOIN finance.audits ON transactions.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Arrange the results with account_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, audit_id, audits.amount, audits.currency FROM finance.transactions JOIN finance.audits ON transactions.audit_id = audits.invoice_id ORDER BY account_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Show me audit_id, traded_at, payment_method for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, traded_at, payment_method FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, traded_at, payment_method FROM finance.transactions ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, traded_at, payment_method FROM finance.transactions ORDER BY exchange_rate DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get account_id, approval_status, payment_method from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, approval_status, payment_method FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with audit_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, approval_status, payment_method FROM finance.transactions ORDER BY audit_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, approval_status, payment_method FROM finance.transactions ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me the count of transactions grouped by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.transactions GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get traded_at, total, buyer_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, total, buyer_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get account_id, exchange_rate, updated_at, quantity by joining transactions with audits.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, total, buyer_id, audits.updated_at, audits.quantity FROM finance.transactions JOIN finance.audits ON transactions.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different exchange_rate values.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM finance.transactions GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY exchange_rate ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up transactions by account_id.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.transactions GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get payment_method, traded_at, audit_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, audit_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, traded_at, audit_id FROM finance.transactions ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Get average of traded_at by buyer_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, AVERAGE(traded_at) AS average_traded_at FROM finance.transactions GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me processed_at, traded_at, cancelled_at, payment_status from transactions and their related audits.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.cancelled_at, audits.payment_status FROM finance.transactions JOIN finance.audits ON transactions.audit_id = audits.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by total ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.cancelled_at, audits.payment_status FROM finance.transactions JOIN finance.audits ON transactions.audit_id = audits.invoice_id ORDER BY total ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp,\n total integer,\n exchange_rate text,\n account_id varchar -- identifier for account,\n approval_status character varying(64) NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_method text NOT NULL,\n currency text,\n audit_id text NOT NULL -- reference to audits.invoice_id,\n FOREIGN KEY (audit_id) REFERENCES audits(invoice_id)\n)\n\nCREATE TABLE finance.audits (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at date,\n amount integer,\n currency varchar,\n payment_status char,\n seller_id character varying(64) NOT NULL,\n quantity varchar\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by audit_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY audit_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY audit_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with age in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY age DESC;", "sql": null}, {"role": "user", "content": "Sort the results by phone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY phone ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get created_at, updated_at, first_name from all users.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, first_name FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by age descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, first_name FROM socialmedia.users ORDER BY age DESC;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, first_name FROM socialmedia.users ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where profile_picture_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE profile_picture_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of first_name by updated_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(first_name) AS max_first_name FROM socialmedia.users GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the updated_at, created_at, bio of each user?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, bio FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What age, full_name, updated_at, created_at do we have for users and their associated comments?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, bio, comments.updated_at, comments.created_at FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Show me sum of created_at grouped by profile_picture_url for users.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, SUM(created_at) AS sum_created_at FROM socialmedia.users GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY created_at ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have comment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE comment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by comment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE comment_id LIKE 'A%' ORDER BY comment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the full_name, updated_at, created_at of each user?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, created_at FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, created_at FROM socialmedia.users WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of users in each first_name category.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM socialmedia.users GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get age, comment_id, bio from all users.", "sql": null}, {"role": "assistant", "content": "SELECT age, comment_id, bio FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get all users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT age, comment_id, bio FROM socialmedia.users WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me min of full_name grouped by age for users.", "sql": null}, {"role": "assistant", "content": "SELECT age, MIN(full_name) AS min_full_name FROM socialmedia.users GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n phone text,\n bio text,\n age char,\n profile_picture_url character varying(256),\n full_name character varying(64),\n first_name char,\n comment_id text NOT NULL -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n score text,\n media_url text,\n user_id character varying(64) -- identifier for user\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by phone descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY phone DESC;", "sql": null}, {"role": "user", "content": "Get count of phone by comment_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(phone) AS count_phone FROM socialmedia.users GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve likes where nationality LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE nationality LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE nationality LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "What are the id, nationality, token of each like?", "sql": null}, {"role": "assistant", "content": "SELECT id, nationality, token FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve likes where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT id, nationality, token FROM socialmedia.likes WHERE joined_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up likes by token.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM socialmedia.likes GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Get all likes from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me count of created_at grouped by joined_at for likes.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(created_at) AS count_created_at FROM socialmedia.likes GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "What nationality, joined_at, address_line2, location_lon do we have for likes and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.address_line2, groups.location_lon FROM socialmedia.likes JOIN socialmedia.groups ON likes.group_id = groups.venue_id;", "sql": null}, {"role": "user", "content": "Get the distribution of likes across different group_id values.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY group_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by membership_level descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY membership_level DESC;", "sql": null}, {"role": "user", "content": "Order the output by group_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY group_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of likes across different joined_at values.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM socialmedia.likes GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "Display all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "What are the group_id, nationality, token of each like?", "sql": null}, {"role": "assistant", "content": "SELECT group_id, nationality, token FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve token, membership_level, address_line1, geo_point showing the relationship between likes and groups.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, nationality, token, groups.address_line1, groups.geo_point FROM socialmedia.likes JOIN socialmedia.groups ON likes.group_id = groups.venue_id;", "sql": null}, {"role": "user", "content": "Tally up likes by token.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM socialmedia.likes GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "Get membership_level, created_at, id from all likes.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, created_at, id FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, created_at, id FROM socialmedia.likes ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by token ascending.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, created_at, id FROM socialmedia.likes ORDER BY token ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n created_at date,\n token varchar,\n membership_level char,\n nationality character varying(256),\n group_id text -- reference to groups.venue_id,\n FOREIGN KEY (group_id) REFERENCES groups(venue_id)\n)\n\nCREATE TABLE socialmedia.groups (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lon char,\n geo_point char,\n address_line2 char,\n address_line1 varchar\n)", "conversations": [{"role": "user", "content": "List id, membership_level, token from likes.", "sql": null}, {"role": "assistant", "content": "SELECT id, membership_level, token FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Arrange the results with group_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT id, membership_level, token FROM socialmedia.likes ORDER BY group_id DESC;", "sql": null}, {"role": "user", "content": "Sort the results by group_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, membership_level, token FROM socialmedia.likes ORDER BY group_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n gender character varying(128),\n birth_date timestamp,\n is_verified bit -- indicates if verified is true,\n city char,\n assignment_id text NOT NULL -- reference to assignments.invoice_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(invoice_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url text NOT NULL,\n thumbnail varchar NOT NULL,\n format character varying(256),\n assignment_id text NOT NULL -- reference to assignments.invoice_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(invoice_id)\n)\n\nCREATE TABLE education.assignments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp,\n delivery_status character varying(256),\n product_id varchar,\n price decimal,\n seller_id character varying(128) NOT NULL -- identifier for seller,\n teacher_id text -- reference to teachers.comment_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(comment_id)\n)\n\nCREATE TABLE education.courses (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n stock_level text,\n views character varying(64),\n name character varying(256),\n student_id integer -- reference to students.user_id,\n assignment_id text NOT NULL -- reference to assignments.invoice_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (assignment_id) REFERENCES assignments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Order the output by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY image_url DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by total descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY total DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve total, created_at, invoice_number, status showing the relationship between notifications and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.invoice_number, metadata.status FROM tradingplatform.notifications JOIN tradingplatform.metadata ON notifications.metadat_id = metadata.transaction_id;", "sql": null}, {"role": "user", "content": "Tally up notifications by cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with metadat_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE metadat_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE metadat_id LIKE 'A%' ORDER BY discount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me created_at, total, approval_status, payment_date from notifications and their related metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.approval_status, metadata.payment_date FROM tradingplatform.notifications JOIN tradingplatform.metadata ON notifications.metadat_id = metadata.transaction_id;", "sql": null}, {"role": "user", "content": "Order the output by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.approval_status, metadata.payment_date FROM tradingplatform.notifications JOIN tradingplatform.metadata ON notifications.metadat_id = metadata.transaction_id ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "What are the metadat_id, cancelled_at, status of each notification?", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, cancelled_at, status FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, cancelled_at, status FROM tradingplatform.notifications WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group notifications by cancelled_at and show the count of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(created_at) AS count_created_at FROM tradingplatform.notifications GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, metadat_id, total for every notification.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, metadat_id, total FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, metadat_id, total FROM tradingplatform.notifications WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up notifications by discount.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List discount, cancelled_at, created_at from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, created_at FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, created_at FROM tradingplatform.notifications WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of notifications in each discount category.", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Get metadat_id, total, created_at from all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, total, created_at FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, total, created_at FROM tradingplatform.notifications WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, total, created_at FROM tradingplatform.notifications WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show the results sorted by cancelled_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY cancelled_at DESC;", "sql": null}, {"role": "user", "content": "Get sum of status by total from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT total, SUM(status) AS sum_status FROM tradingplatform.notifications GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at timestamp without time zone,\n status text NOT NULL,\n total smallint NOT NULL,\n discount smallint NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.transaction_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(transaction_id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(64),\n reconciliation_status varchar,\n status char,\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve cancelled_at, status, discount for every notification.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, status, discount FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, status, discount FROM tradingplatform.notifications ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Tally up notifications by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "List last_name, username, password_hash from clients.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, username, password_hash FROM realestate.clients;", "sql": null}, {"role": "user", "content": "Can you order these by avatar descending?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, username, password_hash FROM realestate.clients ORDER BY avatar DESC;", "sql": null}, {"role": "user", "content": "Get sum of last_name by store_id from clients.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, SUM(last_name) AS sum_last_name FROM realestate.clients GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations;", "sql": null}, {"role": "user", "content": "Retrieve reservations where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of reservations grouped by buyer_id.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(*) AS count FROM realestate.reservations GROUP BY buyer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.clients;", "sql": null}, {"role": "user", "content": "What last_name, username, address_line1, postal_code do we have for clients and their associated stores?", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.address_line1, stores.postal_code FROM realestate.clients JOIN realestate.stores ON clients.store_id = stores.venue_id;", "sql": null}, {"role": "user", "content": "Group clients by store_id and show the min of username.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, MIN(username) AS min_username FROM realestate.clients GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "List username, password_hash, store_id from clients.", "sql": null}, {"role": "assistant", "content": "SELECT username, password_hash, store_id FROM realestate.clients;", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT username, password_hash, store_id FROM realestate.clients ORDER BY username ASC;", "sql": null}, {"role": "user", "content": "How many clients are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM realestate.clients GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "List all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations;", "sql": null}, {"role": "user", "content": "Retrieve reservations where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with customer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me username, password_hash, updated_at for all clients.", "sql": null}, {"role": "assistant", "content": "SELECT username, password_hash, updated_at FROM realestate.clients;", "sql": null}, {"role": "user", "content": "What store_id, password_hash, postal_code, address_line1 do we have for clients and their associated stores?", "sql": null}, {"role": "assistant", "content": "SELECT username, password_hash, updated_at, stores.postal_code, stores.address_line1 FROM realestate.clients JOIN realestate.stores ON clients.store_id = stores.venue_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by password_hash ascending.", "sql": null}, {"role": "assistant", "content": "SELECT username, password_hash, updated_at, stores.postal_code, stores.address_line1 FROM realestate.clients JOIN realestate.stores ON clients.store_id = stores.venue_id ORDER BY password_hash ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations;", "sql": null}, {"role": "user", "content": "Show me reservations that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.reservations WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of reservations across different payment_status values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM realestate.reservations GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.clients;", "sql": null}, {"role": "user", "content": "Order the output by avatar descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.clients ORDER BY avatar DESC;", "sql": null}, {"role": "user", "content": "Show me count of updated_at grouped by store_id for clients.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(updated_at) AS count_updated_at FROM realestate.clients GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me last_name, store_id, updated_at for all clients.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, store_id, updated_at FROM realestate.clients;", "sql": null}, {"role": "user", "content": "What last_name, password_hash, state, address_line1 do we have for clients and their associated stores?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, store_id, updated_at, stores.state, stores.address_line1 FROM realestate.clients JOIN realestate.stores ON clients.store_id = stores.venue_id;", "sql": null}, {"role": "user", "content": "Show me average of username grouped by last_name for clients.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, AVERAGE(username) AS average_username FROM realestate.clients GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username char NOT NULL,\n last_name char,\n password_hash text,\n avatar text,\n store_id text -- reference to stores.venue_id,\n FOREIGN KEY (store_id) REFERENCES stores(venue_id)\n)\n\nCREATE TABLE realestate.stores (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n postal_code character varying(64),\n address_line1 character varying(256) NOT NULL,\n state char NOT NULL\n)\n\nCREATE TABLE realestate.reservations (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at date,\n payment_method text,\n customer_id char -- identifier for customer,\n card_type character varying(64),\n currency char,\n payment_status varchar NOT NULL,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n status character varying(128),\n client_id integer -- reference to clients.user_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me store_id, username, avatar for all clients.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, username, avatar FROM realestate.clients;", "sql": null}, {"role": "user", "content": "Get all clients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, username, avatar FROM realestate.clients WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group clients by last_name and show the min of store_id.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, MIN(store_id) AS min_store_id FROM realestate.clients GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "List timezone, type, city from branches.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, type, city FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Can you order these by timezone ascending?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, type, city FROM logistics.branches ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "How many branches are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM logistics.branches GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve credit, customer_id, category for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, category FROM logistics.finances;", "sql": null}, {"role": "user", "content": "List credit, payee_id, last_login, bio for each finance along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, category, customers.last_login, customers.bio FROM logistics.finances JOIN logistics.customers ON finances.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Order the output by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, category, customers.last_login, customers.bio FROM logistics.finances JOIN logistics.customers ON finances.customer_id = customers.employee_id ORDER BY payee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve credit, category, customer_id for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT credit, category, customer_id FROM logistics.finances;", "sql": null}, {"role": "user", "content": "Get all finances created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT credit, category, customer_id FROM logistics.finances WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of finances grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM logistics.finances GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, payee_id, credit for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, payee_id, credit FROM logistics.finances;", "sql": null}, {"role": "user", "content": "List finances that have category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, payee_id, credit FROM logistics.finances WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of finances in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM logistics.finances GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me credit, customer_id, created_at for all finances.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, created_at FROM logistics.finances;", "sql": null}, {"role": "user", "content": "Retrieve finances where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, created_at FROM logistics.finances WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT credit, customer_id, created_at FROM logistics.finances WHERE created_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the last_inspected, finance_id, timezone of each branche?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, finance_id, timezone FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, finance_id, timezone FROM logistics.branches WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get max of state by customer_id from branches.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(state) AS max_state FROM logistics.branches GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, credit, category of each finance?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, credit, category FROM logistics.finances;", "sql": null}, {"role": "user", "content": "Get all finances from last week.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, credit, category FROM logistics.finances WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of finances grouped by credit.", "sql": null}, {"role": "assistant", "content": "SELECT credit, COUNT(*) AS count FROM logistics.finances GROUP BY credit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Show me state, finance_id, joined_at, last_login from branches and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.last_login FROM logistics.branches JOIN logistics.customers ON branches.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.last_login FROM logistics.branches JOIN logistics.customers ON branches.customer_id = customers.employee_id ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "List city, type, last_login, first_name for each branche along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_login, customers.first_name FROM logistics.branches JOIN logistics.customers ON branches.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of branches in each city category.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM logistics.branches GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.finances (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n payee_id character varying(128) -- identifier for payee,\n credit char,\n category char,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE logistics.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_login date,\n first_name text,\n last_name character varying(64) NOT NULL,\n profile_picture_url character varying(256),\n is_active bit,\n bio varchar\n)\n\nCREATE TABLE logistics.branches (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected date,\n type character varying(256),\n timezone char,\n city character varying(256),\n state char NOT NULL,\n customer_id text -- reference to customers.employee_id,\n finance_id integer -- reference to finances.invoice_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (finance_id) REFERENCES finances(invoice_id)\n)", "conversations": [{"role": "user", "content": "List payee_id, customer_id, created_at from finances.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, customer_id, created_at FROM logistics.finances;", "sql": null}, {"role": "user", "content": "Retrieve credit, category, bio, last_name showing the relationship between finances and customers.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, customer_id, created_at, customers.bio, customers.last_name FROM logistics.finances JOIN logistics.customers ON finances.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, customer_id, created_at, customers.bio, customers.last_name FROM logistics.finances JOIN logistics.customers ON finances.customer_id = customers.employee_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Retrieve payee_id, approval_status, user_id for every finance.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, approval_status, user_id FROM banking.finances;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, approval_status, user_id FROM banking.finances ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Tally up finances by notes.", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM banking.finances GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Show me all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Get all finances from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Display all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Find finances modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Retrieve all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Arrange the results with payee_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "How many finances are there per patient_id?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM banking.finances GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "List patient_id, created_at, user_id from finances.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, created_at, user_id FROM banking.finances;", "sql": null}, {"role": "user", "content": "What user_id, notes, is_verified, country do we have for finances and their associated patients?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, created_at, user_id, patients.is_verified, patients.country FROM banking.finances JOIN banking.patients ON finances.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, created_at, user_id, patients.is_verified, patients.country FROM banking.finances JOIN banking.patients ON finances.patient_id = patients.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Display all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Show me finances that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Show me all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Retrieve finances where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me average of approval_status grouped by notes for finances.", "sql": null}, {"role": "assistant", "content": "SELECT notes, AVERAGE(approval_status) AS average_approval_status FROM banking.finances GROUP BY notes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Get category, notes, payee_id from all finances.", "sql": null}, {"role": "assistant", "content": "SELECT category, notes, payee_id FROM banking.finances;", "sql": null}, {"role": "user", "content": "Show me finances that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT category, notes, payee_id FROM banking.finances WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT category, notes, payee_id FROM banking.finances WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY payee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Display all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Show the results sorted by notes ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances ORDER BY notes ASC;", "sql": null}, {"role": "user", "content": "Tally up finances by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM banking.finances GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.finances (\n account_id text PRIMARY KEY -- unique identifier,\n created_at date,\n category varchar NOT NULL,\n notes text NOT NULL,\n user_id character varying(64) NOT NULL,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n approval_status char NOT NULL,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE banking.orders (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n fee character varying(128) NOT NULL,\n subtotal numeric(38,14) NOT NULL,\n exchange_rate character varying(64) NOT NULL,\n tax bigint,\n customer_id varchar -- identifier for customer,\n payment_status character varying(64) NOT NULL,\n user_id varchar -- identifier for user\n)\n\nCREATE TABLE banking.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n zip_code character varying(64),\n status character varying(256),\n country varchar,\n address char,\n city varchar,\n is_verified boolean\n)", "conversations": [{"role": "user", "content": "Get all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances;", "sql": null}, {"role": "user", "content": "Show me finances with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.finances WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of finances grouped by payee_id.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, COUNT(*) AS count FROM banking.finances GROUP BY payee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Show me address_line2, updated_at, assignment_id for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, updated_at, assignment_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, updated_at, assignment_id FROM education.teachers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up teachers by latitude.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, COUNT(*) AS count FROM education.teachers GROUP BY latitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Get category, assignment_id, updated_at from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT category, assignment_id, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Order the output by parking_available descending.", "sql": null}, {"role": "assistant", "content": "SELECT category, assignment_id, updated_at FROM education.teachers ORDER BY parking_available DESC;", "sql": null}, {"role": "user", "content": "What is the sum category for each category in teachers?", "sql": null}, {"role": "assistant", "content": "SELECT category, SUM(category) AS sum_category FROM education.teachers GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY account_status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get api_key, last_active, state, city by joining students with assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.state, assignments.city FROM education.students JOIN education.assignments ON students.assignment_id = assignments.person_id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.state, assignments.city FROM education.students JOIN education.assignments ON students.assignment_id = assignments.person_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Get website, state, api_key from all students.", "sql": null}, {"role": "assistant", "content": "SELECT website, state, api_key FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by assignment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT website, state, api_key FROM education.students ORDER BY assignment_id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by website.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(*) AS count FROM education.students GROUP BY website ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Get latitude, parking_available, accessibility from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, parking_available, accessibility FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get all teachers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, parking_available, accessibility FROM education.teachers WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me max of address_line2 grouped by longitude for teachers.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, MAX(address_line2) AS max_address_line2 FROM education.teachers GROUP BY longitude;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Show me accessibility, assignment_id, longitude for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, assignment_id, longitude FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, assignment_id, longitude FROM education.teachers WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, assignment_id, longitude FROM education.teachers WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY accessibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "What are the assignment_id, parking_available, category of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, parking_available, category FROM education.teachers;", "sql": null}, {"role": "user", "content": "What longitude, parking_available, username, city do we have for teachers and their associated assignments?", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, parking_available, category, assignments.username, assignments.city FROM education.teachers JOIN education.assignments ON teachers.assignment_id = assignments.person_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT assignment_id, parking_available, category, assignments.username, assignments.city FROM education.teachers JOIN education.assignments ON teachers.assignment_id = assignments.person_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n address_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp,\n parking_available text NOT NULL,\n address_line2 character varying(128) NOT NULL,\n longitude character varying(64) NOT NULL,\n accessibility character varying(256),\n latitude character varying(256) NOT NULL,\n category varchar,\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.students (\n user_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website character varying(64),\n account_status varchar,\n zip_code text NOT NULL,\n api_key text,\n state char,\n salt character varying(128),\n email character varying(64),\n assignment_id text -- reference to assignments.person_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(person_id)\n)\n\nCREATE TABLE education.assignments (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n joined_at date,\n city character varying(128),\n state text,\n is_active boolean -- indicates if active is true,\n username text\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' ORDER BY website DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, account_id, catalo_id for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, account_id, catalo_id FROM logistics.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, account_id, catalo_id FROM logistics.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, account_id, catalo_id FROM logistics.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY account_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.transactions WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.transactions WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "List all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Order the output by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of catalog grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM logistics.catalog GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Get published_at, branche_id, views from all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, branche_id, views FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "List catalog that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, branche_id, views FROM logistics.catalog WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up catalog by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM logistics.catalog GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Get all catalog between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Sort the results by video_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.catalog ORDER BY video_url ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of catalog across different branche_id values.", "sql": null}, {"role": "assistant", "content": "SELECT branche_id, COUNT(*) AS count FROM logistics.catalog GROUP BY branche_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "What are the views, branche_id, published_at of each catalog?", "sql": null}, {"role": "assistant", "content": "SELECT views, branche_id, published_at FROM logistics.catalog;", "sql": null}, {"role": "user", "content": "Retrieve catalog where branche_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT views, branche_id, published_at FROM logistics.catalog WHERE branche_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many catalog are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM logistics.catalog GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "Get all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.branches WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group branches by zip_code and show the min of capacity.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, MIN(capacity) AS min_capacity FROM logistics.branches GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.branches (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n description character varying(256) NOT NULL,\n zip_code character varying(256),\n capacity character varying(64),\n city character varying(64),\n longitude character varying(128),\n catalo_id text -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.transactions (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n tax smallint NOT NULL,\n account_id varchar NOT NULL -- identifier for account,\n seller_id varchar NOT NULL -- identifier for seller,\n customer_id char -- identifier for customer,\n catalo_id text NOT NULL -- reference to catalog.item_id,\n FOREIGN KEY (catalo_id) REFERENCES catalog(item_id)\n)\n\nCREATE TABLE logistics.catalog (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp without time zone,\n views char,\n video_url varchar -- identifier for video_url,\n branche_id text -- reference to branches.id,\n FOREIGN KEY (branche_id) REFERENCES branches(id)\n)", "conversations": [{"role": "user", "content": "List seller_id, catalo_id, customer_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, catalo_id, customer_id FROM logistics.transactions;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, processed_at, updated_at, branche_id showing the relationship between transactions and catalog.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, catalo_id, customer_id, catalog.updated_at, catalog.branche_id FROM logistics.transactions JOIN logistics.catalog ON transactions.catalo_id = catalog.item_id;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, catalo_id, customer_id, catalog.updated_at, catalog.branche_id FROM logistics.transactions JOIN logistics.catalog ON transactions.catalo_id = catalog.item_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.content (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n user_id character varying(64),\n categories text NOT NULL,\n reply_to_id varchar -- identifier for reply_to,\n subject char NOT NULL,\n rating character varying(256),\n parent_id character varying(64) NOT NULL -- identifier for parent,\n likes character varying(64),\n item_id text -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE gaming.stores (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected timestamp,\n country char,\n operating_hours character varying(256),\n name char,\n accessibility character varying(128),\n item_id text NOT NULL -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)\n\nCREATE TABLE gaming.items (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n featured_rank text,\n video_url character varying(64),\n category character varying(256),\n price numeric NOT NULL,\n rating character varying(256),\n conten_id text -- reference to content.post_id,\n FOREIGN KEY (conten_id) REFERENCES content(post_id)\n)\n\nCREATE TABLE gaming.finances (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n notes varchar,\n description character varying(256),\n exchange_rate character varying(64),\n user_id character varying(256) NOT NULL,\n item_id text -- reference to items.sku,\n FOREIGN KEY (item_id) REFERENCES items(sku)\n)", "conversations": [{"role": "user", "content": "Get all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.finances;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.finances ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Can you order these by notes ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.finances ORDER BY notes ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "List description, notes, due_date from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT description, notes, due_date FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, notes, due_date FROM healthcare.doctors WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT description, notes, due_date FROM healthcare.doctors WHERE description LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show the results sorted by notes ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY notes ASC;", "sql": null}, {"role": "user", "content": "What is the count appointment_id for each due_date in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(appointment_id) AS count_appointment_id FROM healthcare.doctors GROUP BY due_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments where doctor_id > 9.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE doctor_id > 9;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE doctor_id > 9 LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by thumbnail ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY thumbnail ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Order the output by text descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY text DESC;", "sql": null}, {"role": "user", "content": "What is the average thumbnail for each user_id in appointments?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(thumbnail) AS average_thumbnail FROM healthcare.appointments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up appointments by tags.", "sql": null}, {"role": "assistant", "content": "SELECT tags, COUNT(*) AS count FROM healthcare.appointments GROUP BY tags ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve category, reconciliation_status, description for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT category, reconciliation_status, description FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Can you order these by notes ascending?", "sql": null}, {"role": "assistant", "content": "SELECT category, reconciliation_status, description FROM healthcare.doctors ORDER BY notes ASC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT category, reconciliation_status, description FROM healthcare.doctors ORDER BY notes ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, doctor_id, user_id from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, doctor_id, user_id FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, doctor_id, user_id FROM healthcare.appointments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, doctor_id, user_id FROM healthcare.appointments WHERE updated_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the text, tags, thumbnail of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT text, tags, thumbnail FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve doctor_id, keywords, description, appointment_id showing the relationship between appointments and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT text, tags, thumbnail, doctors.description, doctors.appointment_id FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.payment_id;", "sql": null}, {"role": "user", "content": "Calculate max of updated_at for each updated_at in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(updated_at) AS max_updated_at FROM healthcare.appointments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n currency character varying(256),\n notes character varying(256),\n reconciliation_status character varying(64),\n category character varying(64) NOT NULL,\n vendor_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n appointment_id text -- reference to appointments.post_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(post_id)\n)\n\nCREATE TABLE healthcare.appointments (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n tags character varying(256) NOT NULL,\n keywords varchar,\n thumbnail char,\n text varchar,\n user_id character varying(128) -- identifier for user,\n doctor_id integer -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate max of user_id for each updated_at in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(user_id) AS max_user_id FROM healthcare.appointments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.students;", "sql": null}, {"role": "user", "content": "Sort the results by transaction_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.students ORDER BY transaction_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by salt descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.students ORDER BY salt DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "Get exchange_rate, payment_status, created_at, location_lat by joining transactions with stores.", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.created_at, stores.location_lat FROM realestate.transactions JOIN realestate.stores ON transactions.store_id = stores.id;", "sql": null}, {"role": "user", "content": "Show me max of payment_status grouped by store_id for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, MAX(payment_status) AS max_payment_status FROM realestate.transactions GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions with completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get max of exchange_rate by completed_at from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, MAX(exchange_rate) AS max_exchange_rate FROM realestate.transactions GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "What traded_at, completed_at, location_lat, parking_available do we have for transactions and their associated stores?", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.location_lat, stores.parking_available FROM realestate.transactions JOIN realestate.stores ON transactions.store_id = stores.id;", "sql": null}, {"role": "user", "content": "Count the number of transactions in each store_id category.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(*) AS count FROM realestate.transactions GROUP BY store_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "List salt, joined_at, birth_date from students.", "sql": null}, {"role": "assistant", "content": "SELECT salt, joined_at, birth_date FROM realestate.students;", "sql": null}, {"role": "user", "content": "Find students where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT salt, joined_at, birth_date FROM realestate.students WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with birth_date in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT salt, joined_at, birth_date FROM realestate.students WHERE joined_at > '2023-01-01' ORDER BY birth_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, location_lat, parking_available for every store.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lat, parking_available FROM realestate.stores;", "sql": null}, {"role": "user", "content": "Order the output by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lat, parking_available FROM realestate.stores ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Get count of created_at by country from stores.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(created_at) AS count_created_at FROM realestate.stores GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the count payment_status for each store_id in transactions?", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(payment_status) AS count_payment_status FROM realestate.transactions GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get birth_date, salt, gender from all students.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, salt, gender FROM realestate.students;", "sql": null}, {"role": "user", "content": "List students that have gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, salt, gender FROM realestate.students WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many students are there per joined_at?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM realestate.students GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "Order the output by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with fee in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions ORDER BY fee DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n payment_status char,\n exchange_rate text,\n delivery_status char,\n fee character varying(128) NOT NULL,\n store_id integer NOT NULL -- reference to stores.id,\n FOREIGN KEY (store_id) REFERENCES stores(id)\n)\n\nCREATE TABLE realestate.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n gender varchar,\n salt character varying(128),\n birth_date timestamp,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE realestate.stores (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected date,\n location_lat char,\n country character varying(256),\n parking_available character varying(128),\n address_line1 char,\n timezone character varying(128) NOT NULL,\n transaction_id text -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.transactions ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Get seller_id, traded_at, status from all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, traded_at, status FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, traded_at, status FROM e-commerce.order_items WHERE traded_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate sum of price for each total in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT total, SUM(price) AS sum_price FROM e-commerce.order_items GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by traded_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY traded_at ASC;", "sql": null}, {"role": "user", "content": "How many order_items are there per price?", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM e-commerce.order_items GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the seller_id, total, price of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, total, price FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, total, price FROM e-commerce.order_items WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by account_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, total, price FROM e-commerce.order_items WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items that have price > 59.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE price > 59;", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by seller_id.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM e-commerce.order_items GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get max of approval_status by total from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT total, MAX(approval_status) AS max_approval_status FROM e-commerce.order_items GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, inventor_id, display_name from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, inventor_id, display_name FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Arrange the results with last_name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, inventor_id, display_name FROM e-commerce.shipping ORDER BY last_name DESC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, inventor_id, display_name FROM e-commerce.shipping ORDER BY last_name DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Sort the results by total descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY total DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve traded_at, status, display_name, inventor_id showing the relationship between order_items and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.display_name, shipping.inventor_id FROM e-commerce.order_items JOIN e-commerce.shipping ON order_items.shippin_id = shipping.customer_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.display_name, shipping.inventor_id FROM e-commerce.order_items JOIN e-commerce.shipping ON order_items.shippin_id = shipping.customer_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve api_key, last_login, updated_at for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, last_login, updated_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, last_login, updated_at FROM e-commerce.shipping WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with last_login in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, last_login, updated_at FROM e-commerce.shipping WHERE country LIKE 'A%' ORDER BY last_login DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n joined_at date,\n last_login timestamp NOT NULL,\n display_name varchar NOT NULL,\n api_key character varying(64),\n country character varying(128) NOT NULL,\n status char,\n last_name varchar,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)\n\nCREATE TABLE e-commerce.inventory (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n title character varying(64) NOT NULL,\n tax_rate character varying(256),\n backorder varchar,\n video_url character varying(64) -- identifier for video_url,\n category varchar NOT NULL,\n rating character varying(128) NOT NULL,\n currency char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n price bigint,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n total decimal,\n approval_status varchar,\n status text,\n account_id character varying(64),\n shippin_id integer NOT NULL -- reference to shipping.customer_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(customer_id)\n)", "conversations": [{"role": "user", "content": "List price, status, total from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT price, status, total FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT price, status, total FROM e-commerce.order_items ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by price ascending.", "sql": null}, {"role": "assistant", "content": "SELECT price, status, total FROM e-commerce.order_items ORDER BY price ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve processed_at, payment_method, text, thumbnail showing the relationship between orders and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.text, categories.thumbnail FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.text, categories.thumbnail FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Get cancelled_at, payment_method, approval_status from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_method, approval_status FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders where customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_method, approval_status FROM e-commerce.orders WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, payment_method, approval_status FROM e-commerce.orders WHERE customer_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Show me approval_status, categorie_id, transaction_id for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, categorie_id, transaction_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get all orders created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, categorie_id, transaction_id FROM e-commerce.orders WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, categorie_id, transaction_id FROM e-commerce.orders WHERE processed_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different card_type values.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM e-commerce.orders GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve processed_at, approval_status, reply_to_id, edited_at showing the relationship between orders and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.reply_to_id, categories.edited_at FROM e-commerce.orders JOIN e-commerce.categories ON orders.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Calculate min of payment_method for each customer_id in orders.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MIN(payment_method) AS min_payment_method FROM e-commerce.orders GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY exchange_rate ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "What are the keywords, thumbnail, views of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT keywords, thumbnail, views FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, thumbnail, views FROM e-commerce.categories ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of categories across different views values.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM e-commerce.categories GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get all orders created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different payment_method values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM e-commerce.orders GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Show me all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get categories that match reply_to_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE reply_to_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE reply_to_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n cancelled_at timestamp,\n card_type character varying(64),\n payment_method char,\n exchange_rate char NOT NULL,\n approval_status char,\n customer_id character varying(64),\n total numeric(38,14) NOT NULL,\n categorie_id text -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected date,\n location_lon char,\n type varchar,\n category char,\n description character varying(64) NOT NULL,\n state char,\n timezone text\n)\n\nCREATE TABLE e-commerce.categories (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n published_at date,\n thumbnail character varying(256),\n keywords character varying(256),\n text character varying(256),\n reply_to_id character varying(256) NOT NULL,\n shares character varying(256),\n views varchar,\n shippin_id text -- reference to shipping.address_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(address_id)\n)", "conversations": [{"role": "user", "content": "Get cancelled_at, card_type, total from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, card_type, total FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Can you order these by categorie_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, card_type, total FROM e-commerce.orders ORDER BY categorie_id ASC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, card_type, total FROM e-commerce.orders ORDER BY categorie_id ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve reservation_id, content, shares for every message.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, content, shares FROM music.messages;", "sql": null}, {"role": "user", "content": "List messages with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT reservation_id, content, shares FROM music.messages WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many messages are there per title?", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM music.messages GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "List price, total, reservation_id, updated_at for each reservation along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.reservation_id, messages.updated_at FROM music.reservations JOIN music.messages ON reservations.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Group reservations by approval_status and show the sum of status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(status) AS sum_status FROM music.reservations GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "Retrieve reservations where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of reservations grouped by fee.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM music.reservations GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get user_id, updated_at, title from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, title FROM music.messages;", "sql": null}, {"role": "user", "content": "List content, updated_at, price, fee for each message along with their reservation information.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, title, reservations.price, reservations.fee FROM music.messages JOIN music.reservations ON messages.reservation_id = reservations.id;", "sql": null}, {"role": "user", "content": "Arrange the results with title in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, updated_at, title, reservations.price, reservations.fee FROM music.messages JOIN music.reservations ON messages.reservation_id = reservations.id ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the message_id, total, card_type of each reservation?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, total, card_type FROM music.reservations;", "sql": null}, {"role": "user", "content": "Can you order these by total descending?", "sql": null}, {"role": "assistant", "content": "SELECT message_id, total, card_type FROM music.reservations ORDER BY total DESC;", "sql": null}, {"role": "user", "content": "Show me sum of payment_status grouped by payment_status for reservations.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, SUM(payment_status) AS sum_payment_status FROM music.reservations GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me fee, message_id, payment_status for all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT fee, message_id, payment_status FROM music.reservations;", "sql": null}, {"role": "user", "content": "Can you order these by status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT fee, message_id, payment_status FROM music.reservations ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT fee, message_id, payment_status FROM music.reservations ORDER BY status ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "Retrieve reservations where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group reservations by status and show the sum of approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT status, SUM(approval_status) AS sum_approval_status FROM music.reservations GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "List updated_at, status, updated_at, shares for each reservation along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.updated_at, messages.shares FROM music.reservations JOIN music.messages ON reservations.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.updated_at, messages.shares FROM music.reservations JOIN music.messages ON reservations.message_id = messages.post_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.reservations;", "sql": null}, {"role": "user", "content": "Get fee, status, content, user_id by joining reservations with messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.content, messages.user_id FROM music.reservations JOIN music.messages ON reservations.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Tally up reservations by status.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM music.reservations GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n shares character varying(256),\n content text,\n title varchar,\n user_id varchar,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE music.reservations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n approval_status text,\n total numeric(38,14),\n card_type text,\n price numeric(38,14),\n status character varying(256),\n fee character varying(256),\n payment_status char,\n message_id text -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE music.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n city text NOT NULL,\n address char,\n password_hash character varying(128),\n full_name character varying(64),\n first_name character varying(128) NOT NULL,\n last_name char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the content, title, shares of each message?", "sql": null}, {"role": "assistant", "content": "SELECT content, title, shares FROM music.messages;", "sql": null}, {"role": "user", "content": "Sort the results by content descending.", "sql": null}, {"role": "assistant", "content": "SELECT content, title, shares FROM music.messages ORDER BY content DESC;", "sql": null}, {"role": "user", "content": "Count the number of messages in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM music.messages GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by media_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Get average of reserved by expires_at from billing.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, AVERAGE(reserved) AS average_reserved FROM healthcare.billing GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "List barcode, created_at, reserved from billing.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, created_at, reserved FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me barcode, reserved, updated_at, created_at from billing and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, created_at, reserved, patients.updated_at, patients.created_at FROM healthcare.billing JOIN healthcare.patients ON billing.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Can you order these by name descending?", "sql": null}, {"role": "assistant", "content": "SELECT barcode, created_at, reserved, patients.updated_at, patients.created_at FROM healthcare.billing JOIN healthcare.patients ON billing.patient_id = patients.user_id ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE latitude LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Show me location_lat, coordinates, created_at for all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, coordinates, created_at FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, coordinates, created_at FROM healthcare.appointments WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max street for each coordinates in appointments?", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, MAX(street) AS max_street FROM healthcare.appointments GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "What are the patient_id, expires_at, name of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, expires_at, name FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, expires_at, name FROM healthcare.billing ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, expires_at, name FROM healthcare.billing ORDER BY name DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List street, coordinates, language, timezone for each appointment along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.language, patients.timezone FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.language, patients.timezone FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.user_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different location_lat values.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM healthcare.appointments GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Get patient_id, barcode, media_url from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, barcode, media_url FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by barcode ascending.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, barcode, media_url FROM healthcare.billing ORDER BY barcode ASC;", "sql": null}, {"role": "user", "content": "Sort the results by reserved descending.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, barcode, media_url FROM healthcare.billing ORDER BY reserved DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Retrieve expires_at, patient_id, created_at for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, patient_id, created_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, patient_id, created_at FROM healthcare.billing WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, patient_id, created_at FROM healthcare.billing WHERE media_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n location_lat character varying(128),\n coordinates text,\n street character varying(64),\n latitude text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n expires_at timestamp without time zone,\n reserved character varying(128) NOT NULL,\n name character varying(64),\n media_url text,\n video_url char,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n username character varying(128),\n token character varying(256) NOT NULL,\n language char NOT NULL,\n timezone text\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve latitude, coordinates, created_at, timezone showing the relationship between appointments and patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.created_at, patients.timezone FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Count the number of appointments in each coordinates category.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, COUNT(*) AS count FROM healthcare.appointments GROUP BY coordinates ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where medical_record_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE medical_record_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many patients are there per timezone?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM healthcare.patients GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve medical_records where subtotal > 78.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE subtotal > 78;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE subtotal > 78 ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by medical_record_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY medical_record_id DESC;", "sql": null}, {"role": "user", "content": "What is the average country for each language in patients?", "sql": null}, {"role": "assistant", "content": "SELECT language, AVERAGE(country) AS average_country FROM healthcare.patients GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by seller_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY seller_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Get medical_record_id, joined_at, timezone from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, joined_at, timezone FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, joined_at, timezone FROM healthcare.patients WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by salt.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM healthcare.patients GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Sort the results by salt ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY salt ASC;", "sql": null}, {"role": "user", "content": "Count the number of patients in each medical_record_id category.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, COUNT(*) AS count FROM healthcare.patients GROUP BY medical_record_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n country char NOT NULL,\n salt character varying(128) NOT NULL,\n language character varying(128),\n timezone character varying(256) NOT NULL,\n last_login date,\n medical_record_id text -- reference to medical_records.payment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at timestamp,\n category text,\n timezone character varying(64),\n description text,\n country char NOT NULL,\n geo_point character varying(256) NOT NULL\n)\n\nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n processed_at date,\n delivery_status character varying(64) NOT NULL,\n subtotal smallint NOT NULL,\n seller_id character varying(256) NOT NULL,\n prescription_id integer -- reference to prescriptions.address_id,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(address_id),\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY delivery_status ASC;", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each subtotal category.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM healthcare.medical_records GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY timezone DESC;", "sql": null}, {"role": "user", "content": "Get max of timezone by timezone from loans.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MAX(timezone) AS max_timezone FROM finance.loans GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me last_name, last_active, id for all investments.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, last_active, id FROM finance.investments;", "sql": null}, {"role": "user", "content": "List investments that have last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, last_active, id FROM finance.investments WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, last_active, id FROM finance.investments WHERE last_name LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with delivery_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE last_login >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE last_login >= CURRENT_DATE - INTERVAL '7 days' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans where state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of state grouped by last_login for loans.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, SUM(state) AS sum_state FROM finance.loans GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Get timezone, last_login, last_active from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, last_active FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get loans that match last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, last_active FROM finance.loans WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by employee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, last_active FROM finance.loans WHERE last_login > '2023-01-01' ORDER BY employee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve last_login, timezone, last_active for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, timezone, last_active FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by timezone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, timezone, last_active FROM finance.loans ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Count the number of loans in each last_active category.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM finance.loans GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show the results sorted by username descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY username DESC;", "sql": null}, {"role": "user", "content": "Calculate count of id for each last_active in investments.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(id) AS count_id FROM finance.investments GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Sort the results by timezone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY timezone ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n password_hash character varying(64),\n username text,\n last_name varchar NOT NULL\n)\n\nCREATE TABLE finance.loans (\n employee_id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp,\n last_login timestamp without time zone,\n timezone character varying(128),\n nationality character varying(64),\n state text NOT NULL\n)\n\nCREATE TABLE finance.payments (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n subtotal decimal NOT NULL,\n status text,\n discount decimal,\n delivery_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get max of password_hash by id from investments.", "sql": null}, {"role": "assistant", "content": "SELECT id, MAX(password_hash) AS max_password_hash FROM finance.investments GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Show me city, last_active, status for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT city, last_active, status FROM humanresources.customers;", "sql": null}, {"role": "user", "content": "Sort the results by addresse_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT city, last_active, status FROM humanresources.customers ORDER BY addresse_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by language ascending?", "sql": null}, {"role": "assistant", "content": "SELECT city, last_active, status FROM humanresources.customers ORDER BY language ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.payments;", "sql": null}, {"role": "user", "content": "Get all payments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.payments WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of payments across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM humanresources.payments GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "List last_name, payment_id, city from customers.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, payment_id, city FROM humanresources.customers;", "sql": null}, {"role": "user", "content": "Order the output by city ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, payment_id, city FROM humanresources.customers ORDER BY city ASC;", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, payment_id, city FROM humanresources.customers ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Get processed_at, addresse_id, reference_number from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, addresse_id, reference_number FROM humanresources.payments;", "sql": null}, {"role": "user", "content": "Order the output by payer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, addresse_id, reference_number FROM humanresources.payments ORDER BY payer_id DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with processed_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, addresse_id, reference_number FROM humanresources.payments ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.addresses WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.addresses WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.customers;", "sql": null}, {"role": "user", "content": "Get all customers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me count of addresse_id grouped by city for customers.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(addresse_id) AS count_addresse_id FROM humanresources.customers GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Get addresse_id, due_date, payer_id from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, due_date, payer_id FROM humanresources.payments;", "sql": null}, {"role": "user", "content": "List payments that have processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, due_date, payer_id FROM humanresources.payments WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate min of payer_id for each reference_number in payments.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, MIN(payer_id) AS min_payer_id FROM humanresources.payments GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.addresses (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n address_line2 char NOT NULL,\n postal_code character varying(64),\n latitude char NOT NULL,\n payment_id text -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE humanresources.payments (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp,\n processed_at date,\n reference_number character varying(64),\n category character varying(128) NOT NULL,\n payer_id character varying(256) NOT NULL -- identifier for payer,\n approval_status character varying(128),\n customer_id text -- reference to customers.employee_id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)\n\nCREATE TABLE humanresources.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n city text,\n language text,\n status char NOT NULL,\n last_name character varying(64),\n avatar varchar NOT NULL,\n payment_id text NOT NULL -- reference to payments.id,\n addresse_id text NOT NULL -- reference to addresses.store_id,\n FOREIGN KEY (payment_id) REFERENCES payments(id),\n FOREIGN KEY (addresse_id) REFERENCES addresses(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve addresse_id, approval_status, payer_id for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, approval_status, payer_id FROM humanresources.payments;", "sql": null}, {"role": "user", "content": "Arrange the results with payer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, approval_status, payer_id FROM humanresources.payments ORDER BY payer_id ASC;", "sql": null}, {"role": "user", "content": "Get count of payer_id by addresse_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, COUNT(payer_id) AS count_payer_id FROM humanresources.payments GROUP BY addresse_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE traded_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of seller_id for each order_item_id in shipping.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, MIN(seller_id) AS min_seller_id FROM e-commerce.shipping GROUP BY order_item_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "List tax_rate, updated_at, expires_at from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, expires_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, expires_at FROM e-commerce.order_items ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, updated_at, expires_at FROM e-commerce.order_items ORDER BY updated_at DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve cost, updated_at, tax_rate for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT cost, updated_at, tax_rate FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Order the output by cost descending.", "sql": null}, {"role": "assistant", "content": "SELECT cost, updated_at, tax_rate FROM e-commerce.order_items ORDER BY cost DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT cost, updated_at, tax_rate FROM e-commerce.order_items ORDER BY cost DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get traded_at, processed_at, updated_at, tax_rate by joining shipping with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.updated_at, order_items.tax_rate FROM e-commerce.shipping JOIN e-commerce.order_items ON shipping.order_item_id = order_items.barcode;", "sql": null}, {"role": "user", "content": "How many shipping are there per payment_status?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM e-commerce.shipping GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with rating in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY rating DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of order_items across different msrp values.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, COUNT(*) AS count FROM e-commerce.order_items GROUP BY msrp ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "List rating, expires_at, cost from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, expires_at, cost FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT rating, expires_at, cost FROM e-commerce.order_items WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT rating, expires_at, cost FROM e-commerce.order_items WHERE updated_at > '2023-12-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the expires_at, msrp, rating of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, msrp, rating FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, msrp, rating FROM e-commerce.order_items WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by cost ascending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, msrp, rating FROM e-commerce.order_items WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY cost ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of order_items across different tax_rate values.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, COUNT(*) AS count FROM e-commerce.order_items GROUP BY tax_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me tax_rate, shippin_id, order_item_id, traded_at from order_items and their related shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.order_item_id, shipping.traded_at FROM e-commerce.order_items JOIN e-commerce.shipping ON order_items.shippin_id = shipping.order_id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.order_item_id, shipping.traded_at FROM e-commerce.order_items JOIN e-commerce.shipping ON order_items.shippin_id = shipping.order_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n barcode varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at date,\n rating text,\n msrp char,\n tax_rate varchar NOT NULL,\n cost bigint NOT NULL,\n shippin_id text -- reference to shipping.order_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(order_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at timestamp without time zone,\n currency character varying(128),\n seller_id char -- identifier for seller,\n payment_status character varying(64),\n order_item_id text -- reference to order_items.barcode,\n FOREIGN KEY (order_item_id) REFERENCES order_items(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount decimal,\n quantity character varying(128) NOT NULL,\n payment_method character varying(64),\n payment_status character varying(128) NOT NULL,\n seller_id character varying(256),\n delivery_status character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where shippin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE shippin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of tax_rate for each shippin_id in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, MIN(tax_rate) AS min_tax_rate FROM e-commerce.order_items GROUP BY shippin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me parking_available, created_at, latitude for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, created_at, latitude FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, created_at, latitude FROM education.assignments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of assignments in each city category.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM education.assignments GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List created_at, department_id, city from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, department_id, city FROM education.assignments;", "sql": null}, {"role": "user", "content": "Arrange the results with parking_available in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, department_id, city FROM education.assignments ORDER BY parking_available ASC;", "sql": null}, {"role": "user", "content": "Order the output by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, department_id, city FROM education.assignments ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by parking_available descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY parking_available DESC;", "sql": null}, {"role": "user", "content": "How many assignments are there per timezone?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM education.assignments GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers where payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by notes descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE payment_id LIKE 'A%' ORDER BY notes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve department_id, address_line2, id for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, address_line2, id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, address_line2, id FROM education.assignments WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min timezone for each created_at in assignments?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(timezone) AS min_timezone FROM education.assignments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by parking_available descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY parking_available DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY parking_available DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "What are the latitude, timezone, parking_available of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT latitude, timezone, parking_available FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, timezone, parking_available FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, timezone, parking_available FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List address_line2, department_id, seller_id, tax for each assignment along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.seller_id, departments.tax FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Group assignments by city and show the count of parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(parking_available) AS count_parking_available FROM education.assignments GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n due_date timestamp,\n payer_id char,\n vendor_id character varying(128) NOT NULL -- identifier for vendor,\n balance integer,\n notes char,\n status character varying(128),\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n country varchar,\n password_hash character varying(256) NOT NULL,\n token character varying(256),\n bio character varying(128) NOT NULL,\n avatar text,\n state char\n)\n\nCREATE TABLE education.departments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n tax bigint,\n delivery_status character varying(256) NOT NULL,\n seller_id character varying(64)\n)\n\nCREATE TABLE education.assignments (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n address_line2 varchar NOT NULL,\n latitude character varying(256),\n city character varying(128),\n parking_available varchar,\n timezone character varying(128) NOT NULL,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Get notes, payer_id, updated_at from all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT notes, payer_id, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by payer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT notes, payer_id, updated_at FROM education.teachers ORDER BY payer_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT notes, payer_id, updated_at FROM education.teachers ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match categories LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE categories LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up reviews by categories.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM e-commerce.reviews GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "List edited_at, thumbnail, rating from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, rating FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, rating FROM e-commerce.reviews WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, rating FROM e-commerce.reviews WHERE rating LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve edited_at, categories, rating for every review.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, rating FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, rating FROM e-commerce.reviews WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by rating descending.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, rating FROM e-commerce.reviews WHERE edited_at > '2023-01-01' ORDER BY rating DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with amount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY amount DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with amount in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get all reviews created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of reviews in each rating category.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM e-commerce.reviews GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve thumbnail, categories, edited_at for every review.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, categories, edited_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with categories in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, categories, edited_at FROM e-commerce.reviews ORDER BY categories ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, categories, edited_at FROM e-commerce.reviews ORDER BY categories ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Get price, payment_status, invoice_id from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT price, payment_status, invoice_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT price, payment_status, invoice_id FROM e-commerce.shipping WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with invoice_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT price, payment_status, invoice_id FROM e-commerce.shipping WHERE invoice_id LIKE 'A%' ORDER BY invoice_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me traded_at, currency, status for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, currency, status FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get all orders created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, currency, status FROM e-commerce.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up orders by amount.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM e-commerce.orders GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me payment_status, approval_status, cancelled_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, approval_status, cancelled_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, approval_status, cancelled_at FROM e-commerce.shipping WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, approval_status, cancelled_at FROM e-commerce.shipping WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n comment_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n thumbnail char,\n categories varchar,\n rating text\n)\n\nCREATE TABLE e-commerce.orders (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n amount bigint,\n status character varying(128),\n currency char\n)\n\nCREATE TABLE e-commerce.shipping (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at date,\n approval_status char,\n payment_status character varying(128) NOT NULL,\n price smallint,\n subtotal numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Order the output by categories descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY categories DESC;", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM e-commerce.reviews GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "What are the published_at, expires_at, sku of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, sku FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, sku FROM finance.loans WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group loans by subcategory and show the min of sku.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, MIN(sku) AS min_sku FROM finance.loans GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Retrieve customer_id, published_at, subcategory for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, published_at, subcategory FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, published_at, subcategory FROM finance.loans ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by quantity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, published_at, subcategory FROM finance.loans ORDER BY quantity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Get price, subcategory, expires_at from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT price, subcategory, expires_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve price, quantity, zip_code, last_name showing the relationship between loans and customers.", "sql": null}, {"role": "assistant", "content": "SELECT price, subcategory, expires_at, customers.zip_code, customers.last_name FROM finance.loans JOIN finance.customers ON loans.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of loans in each sku category.", "sql": null}, {"role": "assistant", "content": "SELECT sku, COUNT(*) AS count FROM finance.loans GROUP BY sku ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE verification_status LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Show me quantity, expires_at, customer_id for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, expires_at, customer_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "List price, subcategory, address, joined_at for each loan along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, expires_at, customer_id, customers.address, customers.joined_at FROM finance.loans JOIN finance.customers ON loans.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, expires_at, customer_id, customers.address, customers.joined_at FROM finance.loans JOIN finance.customers ON loans.customer_id = customers.employee_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "What are the invoice_number, payment_date, customer_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, payment_date, customer_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by verification_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, payment_date, customer_id FROM finance.accounts ORDER BY verification_status DESC;", "sql": null}, {"role": "user", "content": "Can you order these by verification_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, payment_date, customer_id FROM finance.accounts ORDER BY verification_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, expires_at, sku for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, sku FROM finance.loans;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, expires_at, sku FROM finance.loans ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Get max of subcategory by expires_at from loans.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MAX(subcategory) AS max_subcategory FROM finance.loans GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Calculate max of sku for each price in loans.", "sql": null}, {"role": "assistant", "content": "SELECT price, MAX(sku) AS max_sku FROM finance.loans GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "What are the verification_status, customer_id, transaction_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, customer_id, transaction_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, customer_id, transaction_id FROM finance.accounts WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each verification_status category.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM finance.accounts GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n invoice_number character varying(256),\n verification_status varchar,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n published_at date,\n price numeric(38,14),\n quantity varchar,\n subcategory varchar NOT NULL,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n address char NOT NULL,\n account_status character varying(64),\n zip_code character varying(64) NOT NULL,\n last_name character varying(128),\n birth_date timestamp\n)", "conversations": [{"role": "user", "content": "List customer_id, payment_date, verification_status from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_date, verification_status FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me transaction_id, payment_date, account_status, zip_code from accounts and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_date, verification_status, customers.account_status, customers.zip_code FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Arrange the results with verification_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_date, verification_status, customers.account_status, customers.zip_code FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.employee_id ORDER BY verification_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.customers (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language character varying(256),\n profile_picture_url varchar NOT NULL,\n salt character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n bio character varying(256) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status character varying(128) NOT NULL,\n vendor_id character varying(128) NOT NULL,\n credit character varying(128),\n description character varying(256),\n category text,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes character varying(128),\n keywords character varying(64),\n text character varying(256) NOT NULL,\n format character varying(64),\n visibility char,\n body character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.billing;", "sql": null}, {"role": "user", "content": "Get credit, review_id, likes, body by joining billing with reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.likes, reviews.body FROM logistics.billing JOIN logistics.reviews ON billing.review_id = reviews.comment_id;", "sql": null}, {"role": "user", "content": "How many billing are there per description?", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM logistics.billing GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.customers (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language character varying(256),\n profile_picture_url varchar NOT NULL,\n salt character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n bio character varying(256) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status character varying(128) NOT NULL,\n vendor_id character varying(128) NOT NULL,\n credit character varying(128),\n description character varying(256),\n category text,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes character varying(128),\n keywords character varying(64),\n text character varying(256) NOT NULL,\n format character varying(64),\n visibility char,\n body character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve due_date, description, category for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, description, category FROM logistics.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by credit descending.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, description, category FROM logistics.billing ORDER BY credit DESC;", "sql": null}, {"role": "user", "content": "Group billing by review_id and show the max of category.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, MAX(category) AS max_category FROM logistics.billing GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.customers (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language character varying(256),\n profile_picture_url varchar NOT NULL,\n salt character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n bio character varying(256) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status character varying(128) NOT NULL,\n vendor_id character varying(128) NOT NULL,\n credit character varying(128),\n description character varying(256),\n category text,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes character varying(128),\n keywords character varying(64),\n text character varying(256) NOT NULL,\n format character varying(64),\n visibility char,\n body character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by body ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.reviews ORDER BY body ASC;", "sql": null}, {"role": "user", "content": "What is the sum edited_at for each likes in reviews?", "sql": null}, {"role": "assistant", "content": "SELECT likes, SUM(edited_at) AS sum_edited_at FROM logistics.reviews GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.customers (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language character varying(256),\n profile_picture_url varchar NOT NULL,\n salt character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n bio character varying(256) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status character varying(128) NOT NULL,\n vendor_id character varying(128) NOT NULL,\n credit character varying(128),\n description character varying(256),\n category text,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes character varying(128),\n keywords character varying(64),\n text character varying(256) NOT NULL,\n format character varying(64),\n visibility char,\n body character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.billing;", "sql": null}, {"role": "user", "content": "Arrange the results with credit in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.billing ORDER BY credit DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.billing ORDER BY credit DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.customers (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n language character varying(256),\n profile_picture_url varchar NOT NULL,\n salt character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n bio character varying(256) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id),\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.billing (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status character varying(128) NOT NULL,\n vendor_id character varying(128) NOT NULL,\n credit character varying(128),\n description character varying(256),\n category text,\n review_id integer -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)\n\nCREATE TABLE logistics.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes character varying(128),\n keywords character varying(64),\n text character varying(256) NOT NULL,\n format character varying(64),\n visibility char,\n body character varying(128) NOT NULL,\n billin_id text NOT NULL -- reference to billing.invoice_id,\n FOREIGN KEY (billin_id) REFERENCES billing(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.reviews;", "sql": null}, {"role": "user", "content": "Order the output by billin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.reviews ORDER BY billin_id DESC;", "sql": null}, {"role": "user", "content": "Sort the results by likes descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.reviews ORDER BY likes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Calculate min of approval_status for each approval_status in transactions.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MIN(approval_status) AS min_approval_status FROM finance.transactions GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up customers by username.", "sql": null}, {"role": "assistant", "content": "SELECT username, COUNT(*) AS count FROM finance.customers GROUP BY username ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the approval_status, buyer_id, currency of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, buyer_id, currency FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, buyer_id, currency FROM finance.transactions WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, buyer_id, currency FROM finance.transactions WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by payment_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Calculate average of username for each username in customers.", "sql": null}, {"role": "assistant", "content": "SELECT username, AVERAGE(username) AS average_username FROM finance.customers GROUP BY username;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the username, timezone, joined_at of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT username, timezone, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by username ascending?", "sql": null}, {"role": "assistant", "content": "SELECT username, timezone, joined_at FROM finance.customers ORDER BY username ASC;", "sql": null}, {"role": "user", "content": "Sort the results by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT username, timezone, joined_at FROM finance.customers ORDER BY account_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by payment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Show me average of approval_status grouped by currency for transactions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, AVERAGE(approval_status) AS average_approval_status FROM finance.transactions GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "Get payment_method, tax, traded_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, tax, traded_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me traded_at, payment_method, timezone, age from payments and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, tax, traded_at, customers.timezone, customers.age FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.person_id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, tax, traded_at, customers.timezone, customers.age FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.person_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n age char,\n timezone varchar,\n is_verified bit -- indicates if verified is true,\n account_status varchar,\n username character varying(128) NOT NULL,\n payment_id text -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n tax bigint,\n payment_method character varying(128),\n exchange_rate char,\n customer_id integer -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n buyer_id varchar NOT NULL -- identifier for buyer,\n product_id character varying(256) -- identifier for product,\n currency char NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by payment_method descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE payment_method LIKE 'A%' ORDER BY payment_method DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Retrieve all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get categories that match address_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE address_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE address_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Get all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Calculate average of parking_available for each address_id in categories.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, AVERAGE(parking_available) AS average_parking_available FROM e-commerce.categories GROUP BY address_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Retrieve all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get categories that match geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many categories are there per address_id?", "sql": null}, {"role": "assistant", "content": "SELECT address_id, COUNT(*) AS count FROM e-commerce.categories GROUP BY address_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Get updated_at, address_id, parking_available from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available FROM e-commerce.categories ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address_id, parking_available FROM e-commerce.categories ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Get category, name, updated_at from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT category, name, updated_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show the results sorted by geo_point ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, name, updated_at FROM e-commerce.categories ORDER BY geo_point ASC;", "sql": null}, {"role": "user", "content": "What is the min user_id for each user_id in categories?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(user_id) AS min_user_id FROM e-commerce.categories GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Get parking_available, geo_point, name from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, geo_point, name FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, category, created_at, joined_at showing the relationship between categories and users.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, geo_point, name, users.created_at, users.joined_at FROM e-commerce.categories JOIN e-commerce.users ON categories.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, geo_point, name, users.created_at, users.joined_at FROM e-commerce.categories JOIN e-commerce.users ON categories.user_id = users.person_id ORDER BY name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Retrieve geo_point, user_id, address_id for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, user_id, address_id FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Find categories between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, user_id, address_id FROM e-commerce.categories WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, user_id, address_id FROM e-commerce.categories WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "What are the name, updated_at, user_id of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT name, updated_at, user_id FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT name, updated_at, user_id FROM e-commerce.categories ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "How many categories are there per address_id?", "sql": null}, {"role": "assistant", "content": "SELECT address_id, COUNT(*) AS count FROM e-commerce.categories GROUP BY address_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Show me category, user_id, updated_at for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT category, user_id, updated_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List geo_point, name, gender, joined_at for each categorie along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT category, user_id, updated_at, users.gender, users.joined_at FROM e-commerce.categories JOIN e-commerce.users ON categories.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Show me the count of categories grouped by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM e-commerce.categories GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n price numeric,\n payment_status text,\n user_id character varying(128) NOT NULL,\n currency character varying(128) NOT NULL,\n payment_method varchar\n)\n\nCREATE TABLE e-commerce.categories (\n address_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n category varchar,\n geo_point character varying(128) NOT NULL,\n name char,\n parking_available character varying(128) NOT NULL,\n user_id integer -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.users (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp without time zone,\n birth_date timestamp,\n token character varying(64),\n status character varying(256) NOT NULL,\n gender character varying(256),\n first_name char\n)", "conversations": [{"role": "user", "content": "Get all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories with parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group categories by user_id and show the sum of category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(category) AS sum_category FROM e-commerce.categories GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by payment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY payment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE created_at > '2023-01-01' ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "List approval_status, verification_status, invoice_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, invoice_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, invoice_id FROM finance.accounts ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, verification_status, invoice_id FROM finance.accounts ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of processed_at by payment_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, MIN(processed_at) AS min_processed_at FROM finance.transactions GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up transactions by currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM finance.transactions GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me currency, processed_at, payment_method for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, payment_method FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, payment_method FROM finance.transactions WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Calculate count of payment_method for each currency in transactions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(payment_method) AS count_payment_method FROM finance.transactions GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of updated_at for each verification_status in accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(updated_at) AS count_updated_at FROM finance.accounts GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get verification_status, approval_status, updated_at from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, approval_status, updated_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, approval_status, updated_at FROM finance.accounts ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Calculate min of created_at for each verification_status in accounts.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, MIN(created_at) AS min_created_at FROM finance.accounts GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n verification_status character varying(64) NOT NULL,\n reference_number character varying(256),\n approval_status character varying(256) NOT NULL\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n buyer_id character varying(128),\n currency character varying(128),\n payment_method character varying(256)\n)\n\nCREATE TABLE finance.payments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n payment_method character varying(64),\n total smallint,\n delivery_status varchar,\n approval_status varchar,\n product_id character varying(256) -- identifier for product,\n amount bigint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me delivery_status, transaction_id, total for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, transaction_id, total FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, transaction_id, total FROM finance.payments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group payments by delivery_status and show the max of transaction_id.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, MAX(transaction_id) AS max_transaction_id FROM finance.payments GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n currency character varying(256),\n status character varying(256),\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n description text NOT NULL,\n status character varying(256) NOT NULL,\n debit varchar,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.customer_id,\n FOREIGN KEY (investment_id) REFERENCES investments(customer_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility character varying(64) NOT NULL,\n thumbnail character varying(64),\n image_url character varying(256) NOT NULL,\n likes text NOT NULL,\n author_id text NOT NULL -- identifier for author,\n parent_id character varying(256),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country char,\n timezone varchar NOT NULL,\n address character varying(64),\n email char,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with debit LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE debit LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE debit LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp without time zone,\n currency character varying(256),\n status character varying(256),\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n account_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n description text NOT NULL,\n status character varying(256) NOT NULL,\n debit varchar,\n customer_id text NOT NULL -- identifier for customer,\n investment_id text NOT NULL -- reference to investments.customer_id,\n FOREIGN KEY (investment_id) REFERENCES investments(customer_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility character varying(64) NOT NULL,\n thumbnail character varying(64),\n image_url character varying(256) NOT NULL,\n likes text NOT NULL,\n author_id text NOT NULL -- identifier for author,\n parent_id character varying(256),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.investments (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country char,\n timezone varchar NOT NULL,\n address character varying(64),\n email char,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Display all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by email ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY email ASC;", "sql": null}, {"role": "user", "content": "Can you order these by country ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY updated_at ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE updated_at > '2023-12-01' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "List log_id, buyer_id, discount from orders.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, buyer_id, discount FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders that have discount > 14.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, buyer_id, discount FROM tradingplatform.orders WHERE discount > 14;", "sql": null}, {"role": "user", "content": "Can you order these by total descending?", "sql": null}, {"role": "assistant", "content": "SELECT log_id, buyer_id, discount FROM tradingplatform.orders WHERE discount > 14 ORDER BY total DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "Show me score, trade_id, message for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT score, trade_id, message FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT score, trade_id, message FROM tradingplatform.logs WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group logs by updated_at and show the count of score.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(score) AS count_score FROM tradingplatform.logs GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "Get exchange_rate, buyer_id, approval_status from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, buyer_id, approval_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, buyer_id, approval_status FROM tradingplatform.orders WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, buyer_id, approval_status FROM tradingplatform.orders WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the max buyer_id for each total in orders?", "sql": null}, {"role": "assistant", "content": "SELECT total, MAX(buyer_id) AS max_buyer_id FROM tradingplatform.orders GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "What are the total, discount, exchange_rate of each order?", "sql": null}, {"role": "assistant", "content": "SELECT total, discount, exchange_rate FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT total, discount, exchange_rate FROM tradingplatform.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of orders in each total category.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM tradingplatform.orders GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "Show me order_id, updated_at, trade_id for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, updated_at, trade_id FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, updated_at, trade_id FROM tradingplatform.logs ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by trade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, updated_at, trade_id FROM tradingplatform.logs ORDER BY trade_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Get max of log_id by exchange_rate from orders.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, MAX(log_id) AS max_log_id FROM tradingplatform.orders GROUP BY exchange_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n total bigint,\n discount decimal NOT NULL,\n buyer_id char NOT NULL,\n exchange_rate character varying(256) NOT NULL,\n approval_status varchar,\n log_id text -- reference to logs.comment_id,\n FOREIGN KEY (log_id) REFERENCES logs(comment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n message text,\n author_id varchar,\n image_url character varying(256),\n shares character varying(64),\n score varchar,\n trade_id text -- reference to trades.transaction_id,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id),\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_method varchar,\n card_type character varying(256) NOT NULL,\n price bigint\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by last_active descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Can you order these by avatar ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY avatar ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "List avatar, created_at, last_active from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, created_at, last_active FROM education.assignments;", "sql": null}, {"role": "user", "content": "Order the output by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, created_at, last_active FROM education.assignments ORDER BY display_name DESC;", "sql": null}, {"role": "user", "content": "Sort the results by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, created_at, last_active FROM education.assignments ORDER BY display_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Get last_active, created_at, avatar from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, created_at, avatar FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, created_at, avatar FROM education.assignments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, created_at, avatar FROM education.assignments WHERE created_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with payee_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY payee_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by transaction_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY transaction_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "What are the membership_level, display_name, created_at of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, display_name, created_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, display_name, created_at FROM education.assignments ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, display_name, created_at FROM education.assignments ORDER BY created_at ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Arrange the results with payee_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY payee_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades where due_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE due_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE due_date > '2023-01-01' ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with notes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE notes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE notes LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at date,\n display_name char,\n avatar character varying(64),\n membership_level varchar\n)\n\nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n approval_status text NOT NULL,\n notes character varying(128),\n description character varying(256),\n currency character varying(64),\n payee_id character varying(128),\n reference_number text\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many grades are there per notes?", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM education.grades GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items ORDER BY published_at DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "List review_id, customer_id, state from users.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, customer_id, state FROM humanresources.users;", "sql": null}, {"role": "user", "content": "Get all users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, customer_id, state FROM humanresources.users WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many users are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM humanresources.users GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Get review_id, published_at, user_id, views by joining items with reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.user_id, reviews.views FROM humanresources.items JOIN humanresources.reviews ON items.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.user_id, reviews.views FROM humanresources.items JOIN humanresources.reviews ON items.review_id = reviews.post_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.users;", "sql": null}, {"role": "user", "content": "List users with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by email ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY email ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "What are the published_at, manufacturer, brand of each item?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, manufacturer, brand FROM humanresources.items;", "sql": null}, {"role": "user", "content": "List brand, manufacturer, author_id, user_id for each item along with their review information.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, manufacturer, brand, reviews.author_id, reviews.user_id FROM humanresources.items JOIN humanresources.reviews ON items.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "Group items by review_id and show the average of manufacturer.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, AVERAGE(manufacturer) AS average_manufacturer FROM humanresources.items GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "List timezone, salt, joined_at from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, salt, joined_at FROM humanresources.users;", "sql": null}, {"role": "user", "content": "Get timezone, email, edited_at, attachment_url by joining users with reviews.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, salt, joined_at, reviews.edited_at, reviews.attachment_url FROM humanresources.users JOIN humanresources.reviews ON users.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "Calculate min of joined_at for each email in users.", "sql": null}, {"role": "assistant", "content": "SELECT email, MIN(joined_at) AS min_joined_at FROM humanresources.users GROUP BY email;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "What are the salt, timezone, customer_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT salt, timezone, customer_id FROM humanresources.users;", "sql": null}, {"role": "user", "content": "What review_id, salt, score, image_url do we have for users and their associated reviews?", "sql": null}, {"role": "assistant", "content": "SELECT salt, timezone, customer_id, reviews.score, reviews.image_url FROM humanresources.users JOIN humanresources.reviews ON users.review_id = reviews.post_id;", "sql": null}, {"role": "user", "content": "Tally up users by review_id.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, COUNT(*) AS count FROM humanresources.users GROUP BY review_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve salt, email, state for every user.", "sql": null}, {"role": "assistant", "content": "SELECT salt, email, state FROM humanresources.users;", "sql": null}, {"role": "user", "content": "Sort the results by salt ascending.", "sql": null}, {"role": "assistant", "content": "SELECT salt, email, state FROM humanresources.users ORDER BY salt ASC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT salt, email, state FROM humanresources.users ORDER BY salt ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.users;", "sql": null}, {"role": "user", "content": "List users with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get min of customer_id by email from users.", "sql": null}, {"role": "assistant", "content": "SELECT email, MIN(customer_id) AS min_customer_id FROM humanresources.users GROUP BY email;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n product_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n brand text NOT NULL,\n views char,\n manufacturer text,\n available character varying(64) NOT NULL,\n currency varchar NOT NULL,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)\n\nCREATE TABLE humanresources.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n score text,\n views character varying(128),\n attachment_url varchar NOT NULL,\n author_id character varying(64) -- identifier for author,\n image_url text NOT NULL,\n user_id character varying(128) -- identifier for user\n)\n\nCREATE TABLE humanresources.users (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n timezone char,\n salt character varying(256) NOT NULL,\n email character varying(128),\n state char,\n review_id integer -- reference to reviews.post_id,\n FOREIGN KEY (review_id) REFERENCES reviews(post_id)\n)", "conversations": [{"role": "user", "content": "Get all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Arrange the results with manufacturer in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items ORDER BY manufacturer DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of items across different available values.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM humanresources.items GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise;", "sql": null}, {"role": "user", "content": "Find merchandise between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.transactions;", "sql": null}, {"role": "user", "content": "Find transactions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with buyer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.transactions WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "List all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise;", "sql": null}, {"role": "user", "content": "List merchandise with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of merchandise across different name values.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM humanresources.merchandise GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "Display all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.venues;", "sql": null}, {"role": "user", "content": "Can you order these by zip_code descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.venues ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Count the number of venues in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM humanresources.venues GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.venues;", "sql": null}, {"role": "user", "content": "Retrieve venues where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.venues WHERE last_inspected > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.venues WHERE last_inspected > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "Display all merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise;", "sql": null}, {"role": "user", "content": "Arrange the results with price in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise ORDER BY price ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.merchandise ORDER BY price ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.venues (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at date,\n zip_code character varying(256),\n parking_available varchar,\n capacity character varying(256),\n city character varying(256),\n accessibility char NOT NULL,\n type varchar,\n transaction_id text NOT NULL -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE humanresources.merchandise (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n price numeric,\n title character varying(128),\n name character varying(128),\n subcategory character varying(128) NOT NULL,\n venue_id text -- reference to venues.venue_id,\n FOREIGN KEY (venue_id) REFERENCES venues(venue_id)\n)\n\nCREATE TABLE humanresources.transactions (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp without time zone,\n buyer_id char,\n product_id char NOT NULL,\n price bigint NOT NULL,\n account_id character varying(64) NOT NULL -- identifier for account,\n card_type character varying(128),\n tax smallint NOT NULL,\n discount bigint NOT NULL,\n merchandis_id text NOT NULL -- reference to merchandise.item_id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(item_id)\n)", "conversations": [{"role": "user", "content": "What are the price, tax, processed_at of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT price, tax, processed_at FROM humanresources.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT price, tax, processed_at FROM humanresources.transactions WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many transactions are there per processed_at?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM humanresources.transactions GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Show me keywords, description, published_at for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, description, published_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, description, published_at FROM tradingplatform.logs ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Group logs by author_id and show the count of keywords.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(keywords) AS count_keywords FROM tradingplatform.logs GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show the results sorted by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY description DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of asset_id grouped by thumbnail for logs.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, AVERAGE(asset_id) AS average_asset_id FROM tradingplatform.logs GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by due_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY due_date DESC;", "sql": null}, {"role": "user", "content": "Show me average of created_at grouped by description for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(created_at) AS average_created_at FROM tradingplatform.wallets GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Get id, due_date, asset_id from all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT id, due_date, asset_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get all wallets from last week.", "sql": null}, {"role": "assistant", "content": "SELECT id, due_date, asset_id FROM tradingplatform.wallets WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT id, due_date, asset_id FROM tradingplatform.wallets WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Get notes, customer_id, id from all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT notes, customer_id, id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Sort the results by payer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT notes, customer_id, id FROM tradingplatform.wallets ORDER BY payer_id ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT notes, customer_id, id FROM tradingplatform.wallets ORDER BY payer_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get customer_id, id, image_url, created_at by joining wallets with assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.image_url, assets.created_at FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.item_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by due_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.image_url, assets.created_at FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.item_id ORDER BY due_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve logs where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of payer_id grouped by notes for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT notes, SUM(payer_id) AS sum_payer_id FROM tradingplatform.wallets GROUP BY notes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n description varchar,\n keywords character varying(256) NOT NULL,\n author_id character varying(256) -- identifier for author,\n thumbnail character varying(64) NOT NULL,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n popularity_score text,\n views text NOT NULL,\n backorder character varying(128),\n image_url varchar\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n payer_id character varying(64),\n customer_id character varying(256) NOT NULL,\n notes character varying(256),\n description char,\n approval_status char,\n asset_id integer -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group logs by description and show the count of asset_id.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(asset_id) AS count_asset_id FROM tradingplatform.logs GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with traded_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY traded_at ASC;", "sql": null}, {"role": "user", "content": "What is the count wallet_id for each buyer_id in orders?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(wallet_id) AS count_wallet_id FROM tradingplatform.orders GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get buyer_id, seller_id, payment_method from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, seller_id, payment_method FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List buyer_id, traded_at, payee_id, invoice_number for each order along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, seller_id, payment_method, wallets.payee_id, wallets.invoice_number FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.transaction_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, seller_id, payment_method, wallets.payee_id, wallets.invoice_number FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of wallets in each invoice_number category.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY invoice_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get wallets that match payee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payee_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me buyer_id, traded_at, payment_method for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, traded_at, payment_method FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What card_type, payment_method, due_date, balance do we have for orders and their associated wallets?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, traded_at, payment_method, wallets.due_date, wallets.balance FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.transaction_id;", "sql": null}, {"role": "user", "content": "Sort the results by seller_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, traded_at, payment_method, wallets.due_date, wallets.balance FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.transaction_id ORDER BY seller_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by balance ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY balance ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY payee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Sort the results by invoice_number ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY invoice_number ASC;", "sql": null}, {"role": "user", "content": "Count the number of wallets in each invoice_number category.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY invoice_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n seller_id text -- identifier for seller,\n approval_status character varying(256),\n payment_method character varying(256),\n card_type character varying(256),\n buyer_id text NOT NULL,\n wallet_id text -- reference to wallets.transaction_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(transaction_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n payee_id character varying(256) -- identifier for payee,\n invoice_number character varying(64),\n balance numeric(38,14) NOT NULL,\n order_id integer -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders where buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE buyer_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Calculate max of rating for each updated_at in likes.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(rating) AS max_rating FROM socialmedia.likes GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me sum of media_url grouped by edited_at for likes.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, SUM(media_url) AS sum_media_url FROM socialmedia.likes GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with parent_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY parent_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, author_id, media_url for every like.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, media_url FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show me likes with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, media_url FROM socialmedia.likes WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, media_url FROM socialmedia.likes WHERE media_url LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Get format, author_id, rating from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, rating FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get parent_id, rating, postal_code, updated_at by joining posts with events.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, rating, events.postal_code, events.updated_at FROM socialmedia.posts JOIN socialmedia.events ON posts.event_id = events.store_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, rating, events.postal_code, events.updated_at FROM socialmedia.posts JOIN socialmedia.events ON posts.event_id = events.store_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List updated_at, author_id, edited_at from likes.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, edited_at FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, author_id, edited_at FROM socialmedia.likes WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of likes in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.likes GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the format, created_at, rating of each post?", "sql": null}, {"role": "assistant", "content": "SELECT format, created_at, rating FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Order the output by event_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT format, created_at, rating FROM socialmedia.posts ORDER BY event_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT format, created_at, rating FROM socialmedia.posts ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "List parent_id, author_id, event_id from posts.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, author_id, event_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts from last week.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, author_id, event_id FROM socialmedia.posts WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, author_id, event_id FROM socialmedia.posts WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n author_id varchar,\n parent_id text,\n format text,\n user_id text -- identifier for user,\n rating text NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.likes (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at timestamp,\n shares character varying(64),\n author_id character varying(256),\n rating text,\n media_url varchar,\n keywords varchar NOT NULL,\n post_id text -- reference to posts.comment_id,\n FOREIGN KEY (post_id) REFERENCES posts(comment_id)\n)\n\nCREATE TABLE socialmedia.events (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at date,\n location_lat character varying(256),\n location_lon text NOT NULL,\n name character varying(128) NOT NULL,\n postal_code char NOT NULL\n)\n\nCREATE TABLE socialmedia.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n last_name text,\n first_name character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show me likes with shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of likes grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.likes GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many order_items are there per last_name?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, COUNT(*) AS count FROM e-commerce.order_items GROUP BY last_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show the results sorted by manufacturer descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY manufacturer DESC;", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM e-commerce.products GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show the results sorted by display_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY display_name ASC;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with country in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Show me average of last_active grouped by country for order_items.", "sql": null}, {"role": "assistant", "content": "SELECT country, AVERAGE(last_active) AS average_last_active FROM e-commerce.order_items GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve review_id, order_item_id, published_at, format showing the relationship between products and reviews.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.published_at, reviews.format FROM e-commerce.products JOIN e-commerce.reviews ON products.review_id = reviews.content_id;", "sql": null}, {"role": "user", "content": "Arrange the results with featured_rank in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, reviews.published_at, reviews.format FROM e-commerce.products JOIN e-commerce.reviews ON products.review_id = reviews.content_id ORDER BY featured_rank ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "List all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get display_name, age, published_at, tax_rate by joining order_items with products.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.published_at, products.tax_rate FROM e-commerce.order_items JOIN e-commerce.products ON order_items.product_id = products.id;", "sql": null}, {"role": "user", "content": "Get the distribution of order_items across different age values.", "sql": null}, {"role": "assistant", "content": "SELECT age, COUNT(*) AS count FROM e-commerce.order_items GROUP BY age ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me product_id, last_name, price, featured_rank from order_items and their related products.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.price, products.featured_rank FROM e-commerce.order_items JOIN e-commerce.products ON order_items.product_id = products.id;", "sql": null}, {"role": "user", "content": "Order the output by last_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.price, products.featured_rank FROM e-commerce.order_items JOIN e-commerce.products ON order_items.product_id = products.id ORDER BY last_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "List all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_name LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up products by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM e-commerce.products GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n manufacturer text NOT NULL,\n featured_rank text NOT NULL,\n reserved character varying(256),\n tax_rate varchar,\n price smallint,\n review_id integer NOT NULL -- reference to reviews.content_id,\n order_item_id text -- reference to order_items.user_id,\n FOREIGN KEY (review_id) REFERENCES reviews(content_id),\n FOREIGN KEY (order_item_id) REFERENCES order_items(user_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n user_id text PRIMARY KEY -- unique identifier,\n last_active date,\n display_name character varying(256),\n last_name character varying(64) NOT NULL,\n age character varying(256),\n country char,\n product_id text NOT NULL -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)\n\nCREATE TABLE e-commerce.reviews (\n content_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n edited_at timestamp without time zone,\n rating text,\n reply_to_id varchar NOT NULL,\n media_url varchar,\n format text NOT NULL,\n keywords character varying(256) NOT NULL,\n user_id character varying(64),\n views varchar\n)", "conversations": [{"role": "user", "content": "List all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get all order_items modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the average age for each last_active in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, AVERAGE(age) AS average_age FROM e-commerce.order_items GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List account_id, payment_status, grade_id from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payment_status, grade_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payment_status, grade_id FROM education.enrollments WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me min of grade_id grouped by grade_id for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, MIN(grade_id) AS min_grade_id FROM education.enrollments GROUP BY grade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List completed_at, tax, payment_status from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, tax, payment_status FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, tax, payment_status FROM education.enrollments WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Sort the results by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, tax, payment_status FROM education.enrollments WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY account_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY completed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve tax, completed_at, image_url, reserved showing the relationship between enrollments and grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.image_url, grades.reserved FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.product_id;", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by completed_at.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(*) AS count FROM education.enrollments GROUP BY completed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me account_id, grade_id, tax for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, grade_id, tax FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get payment_status, grade_id, reserved, discount by joining enrollments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, grade_id, tax, grades.reserved, grades.discount FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.product_id;", "sql": null}, {"role": "user", "content": "Calculate count of tax for each tax in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT tax, COUNT(tax) AS count_tax FROM education.enrollments GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "List tax, payment_status, grade_id from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT tax, payment_status, grade_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT tax, payment_status, grade_id FROM education.enrollments WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT tax, payment_status, grade_id FROM education.enrollments WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve payment_status, grade_id, tax for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, grade_id, tax FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, grade_id, tax FROM education.enrollments ORDER BY payment_status ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, grade_id, tax FROM education.enrollments ORDER BY payment_status ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "Get completed_at, grade_id, tax from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, grade_id, tax FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me completed_at, tax, discount, image_url from enrollments and their related grades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, grade_id, tax, grades.discount, grades.image_url FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.product_id;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, grade_id, tax, grades.discount, grades.image_url FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.product_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n tax decimal,\n account_id character varying(128) NOT NULL,\n payment_status character varying(64) NOT NULL,\n grade_id text NOT NULL -- reference to grades.product_id,\n FOREIGN KEY (grade_id) REFERENCES grades(product_id)\n)\n\nCREATE TABLE education.grades (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n image_url character varying(64) NOT NULL,\n discount decimal,\n reserved character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with account_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "List items with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me views, facilitie_id, category for all items.", "sql": null}, {"role": "assistant", "content": "SELECT views, facilitie_id, category FROM government.items;", "sql": null}, {"role": "user", "content": "Show the results sorted by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT views, facilitie_id, category FROM government.items ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of items across different category values.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM government.items GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Get items that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get count of facilitie_id by description from items.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(facilitie_id) AS count_facilitie_id FROM government.items GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Show the results sorted by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY category DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me facilitie_id, description, views for all items.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, description, views FROM government.items;", "sql": null}, {"role": "user", "content": "What description, expires_at, address_line1, capacity do we have for items and their associated facilities?", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, description, views, facilities.address_line1, facilities.capacity FROM government.items JOIN government.facilities ON items.facilitie_id = facilities.location_id;", "sql": null}, {"role": "user", "content": "How many items are there per facilitie_id?", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, COUNT(*) AS count FROM government.items GROUP BY facilitie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me description, facilitie_id, category for all items.", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category FROM government.items;", "sql": null}, {"role": "user", "content": "Retrieve description, facilitie_id, address_line1, last_inspected showing the relationship between items and facilities.", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category, facilities.address_line1, facilities.last_inspected FROM government.items JOIN government.facilities ON items.facilitie_id = facilities.location_id;", "sql": null}, {"role": "user", "content": "Order the output by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category, facilities.address_line1, facilities.last_inspected FROM government.items JOIN government.facilities ON items.facilitie_id = facilities.location_id ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Find items modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me min of facilitie_id grouped by expires_at for items.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MIN(facilitie_id) AS min_facilitie_id FROM government.items GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "List facilitie_id, description, expires_at from items.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, description, expires_at FROM government.items;", "sql": null}, {"role": "user", "content": "List items that have category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, description, expires_at FROM government.items WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, description, expires_at FROM government.items WHERE category LIKE 'A%' ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Can you order these by description descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.items (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description char,\n category char,\n views character varying(256),\n facilitie_id text -- reference to facilities.location_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id)\n)\n\nCREATE TABLE government.facilities (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n longitude varchar NOT NULL,\n capacity varchar,\n street varchar,\n address_line1 character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me description, facilitie_id, category for all items.", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category FROM government.items;", "sql": null}, {"role": "user", "content": "What description, views, street, last_inspected do we have for items and their associated facilities?", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category, facilities.street, facilities.last_inspected FROM government.items JOIN government.facilities ON items.facilitie_id = facilities.location_id;", "sql": null}, {"role": "user", "content": "Order the output by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, facilitie_id, category, facilities.street, facilities.last_inspected FROM government.items JOIN government.facilities ON items.facilitie_id = facilities.location_id ORDER BY category DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get verification_status, payer_id, notification_id from all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, notification_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where notification_id > 70.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, notification_id FROM tradingplatform.wallets WHERE notification_id > 70;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, notification_id FROM tradingplatform.wallets WHERE notification_id > 70 LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets where due_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Can you order these by debit ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY debit ASC;", "sql": null}, {"role": "user", "content": "Count the number of wallets in each due_date category.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "List verification_status, id, due_date from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, id, due_date FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, id, due_date FROM tradingplatform.wallets ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Group wallets by notification_id and show the count of due_date.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, COUNT(due_date) AS count_due_date FROM tradingplatform.wallets GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the payer_id, id, due_date of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, id, due_date FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets that have notification_id > 60.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, id, due_date FROM tradingplatform.wallets WHERE notification_id > 60;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, id, due_date FROM tradingplatform.wallets WHERE notification_id > 60 ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, id, payer_id of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, id, payer_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, id, payer_id FROM tradingplatform.wallets WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the sum due_date for each id in wallets?", "sql": null}, {"role": "assistant", "content": "SELECT id, SUM(due_date) AS sum_due_date FROM tradingplatform.wallets GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve verification_status, payer_id, id for every wallet.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets that have id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, id FROM tradingplatform.wallets WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of payer_id by id from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT id, AVERAGE(payer_id) AS average_payer_id FROM tradingplatform.wallets GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE due_date BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me average of payer_id grouped by debit for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT debit, AVERAGE(payer_id) AS average_payer_id FROM tradingplatform.wallets GROUP BY debit;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me debit, customer_id, due_date for all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT debit, customer_id, due_date FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "What id, verification_status, processed_at, payment_status do we have for wallets and their associated notifications?", "sql": null}, {"role": "assistant", "content": "SELECT debit, customer_id, due_date, notifications.processed_at, notifications.payment_status FROM tradingplatform.wallets JOIN tradingplatform.notifications ON wallets.notification_id = notifications.invoice_id;", "sql": null}, {"role": "user", "content": "Calculate sum of customer_id for each payer_id in wallets.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, SUM(customer_id) AS sum_customer_id FROM tradingplatform.wallets GROUP BY payer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n processed_at date,\n customer_id character varying(64),\n delivery_status character varying(64),\n payment_status character varying(64)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n customer_id text -- identifier for customer,\n verification_status varchar NOT NULL,\n debit character varying(128),\n payer_id character varying(128),\n notification_id integer -- reference to notifications.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve payer_id, debit, customer_id, traded_at showing the relationship between wallets and notifications.", "sql": null}, {"role": "assistant", "content": "SELECT *, notifications.customer_id, notifications.traded_at FROM tradingplatform.wallets JOIN tradingplatform.notifications ON wallets.notification_id = notifications.invoice_id;", "sql": null}, {"role": "user", "content": "How many wallets are there per debit?", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate min of created_at for each course_id in departments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, MIN(created_at) AS min_created_at FROM education.departments GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by seller_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE user_id LIKE 'A%' ORDER BY seller_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "List completed_at, seller_id, user_id from grades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, seller_id, user_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, seller_id, user_id FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, seller_id, user_id FROM education.grades WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "List user_id, cancelled_at, department_id from grades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, cancelled_at, department_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Get grades that match cancelled_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, cancelled_at, department_id FROM education.grades WHERE cancelled_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of cancelled_at grouped by user_id for grades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(cancelled_at) AS average_cancelled_at FROM education.grades GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "What are the cancelled_at, user_id, completed_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, user_id, completed_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve user_id, seller_id, approval_status, reference_number showing the relationship between grades and departments.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, user_id, completed_at, departments.approval_status, departments.reference_number FROM education.grades JOIN education.departments ON grades.department_id = departments.account_id;", "sql": null}, {"role": "user", "content": "Group grades by cancelled_at and show the sum of cancelled_at.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, SUM(cancelled_at) AS sum_cancelled_at FROM education.grades GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "List seller_id, completed_at, cancelled_at from grades.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, completed_at, cancelled_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me price, cancelled_at, approval_status, reference_number from grades and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, completed_at, cancelled_at, departments.approval_status, departments.reference_number FROM education.grades JOIN education.departments ON grades.department_id = departments.account_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, completed_at, cancelled_at, departments.approval_status, departments.reference_number FROM education.grades JOIN education.departments ON grades.department_id = departments.account_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Get departments that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many departments are there per approval_status?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM education.departments GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades that have cancelled_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE cancelled_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE cancelled_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64),\n status text,\n approval_status character varying(64),\n vendor_id char -- identifier for vendor,\n reconciliation_status char NOT NULL,\n course_id text -- reference to courses.id,\n FOREIGN KEY (course_id) REFERENCES courses(id)\n)\n\nCREATE TABLE education.courses (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n payer_id char -- identifier for payer,\n invoice_number character varying(64),\n notes varchar NOT NULL,\n customer_id text NOT NULL -- identifier for customer,\n reconciliation_status character varying(128),\n approval_status text NOT NULL\n)\n\nCREATE TABLE education.grades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at timestamp without time zone,\n seller_id character varying(64) -- identifier for seller,\n user_id text,\n price smallint,\n department_id text NOT NULL -- reference to departments.account_id,\n FOREIGN KEY (department_id) REFERENCES departments(account_id)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades that have seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with cancelled_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE seller_id LIKE 'A%' ORDER BY cancelled_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get subcategory, cost, parking_available, updated_at by joining inventory with categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.parking_available, categories.updated_at FROM e-commerce.inventory JOIN e-commerce.categories ON inventory.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "Calculate min of cost for each views in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT views, MIN(cost) AS min_cost FROM e-commerce.inventory GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get card_type, total, product_id from all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, total, product_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, total, product_id FROM e-commerce.order_items WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average total for each categorie_id in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, AVERAGE(total) AS average_total FROM e-commerce.order_items GROUP BY categorie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me timezone, updated_at, created_at for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, updated_at, created_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Sort the results by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, updated_at, created_at FROM e-commerce.categories ORDER BY address_line2 ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, updated_at, created_at FROM e-commerce.categories ORDER BY address_line2 ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "List timezone, updated_at, created_at from categories.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, updated_at, created_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "What updated_at, address_line2, categorie_id, card_type do we have for categories and their associated order_items?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, updated_at, created_at, order_items.categorie_id, order_items.card_type FROM e-commerce.categories JOIN e-commerce.order_items ON categories.order_item_id = order_items.invoice_id;", "sql": null}, {"role": "user", "content": "Count the number of categories in each parking_available category.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM e-commerce.categories GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Retrieve manufacturer, created_at, categorie_id for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, created_at, categorie_id FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with cost in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, created_at, categorie_id FROM e-commerce.inventory ORDER BY cost ASC;", "sql": null}, {"role": "user", "content": "Sort the results by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, created_at, categorie_id FROM e-commerce.inventory ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items with product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE product_id LIKE 'A%' ORDER BY payment_method ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE product_id LIKE 'A%' ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve total, categorie_id, order_item_id, address_line2 showing the relationship between order_items and categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.order_item_id, categories.address_line2 FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.order_item_id, categories.address_line2 FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get processed_at, amount, created_at, timezone by joining order_items with categories.", "sql": null}, {"role": "assistant", "content": "SELECT *, categories.created_at, categories.timezone FROM e-commerce.order_items JOIN e-commerce.categories ON order_items.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "Count the number of order_items in each amount category.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM e-commerce.order_items GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n card_type char,\n amount integer,\n product_id character varying(128) NOT NULL -- identifier for product,\n payment_method varchar,\n total numeric(38,14) NOT NULL,\n categorie_id text NOT NULL -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n timezone character varying(256),\n address_line2 character varying(256),\n parking_available character varying(64),\n order_item_id text NOT NULL -- reference to order_items.invoice_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(invoice_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n created_at date,\n manufacturer varchar,\n subcategory char NOT NULL,\n msrp character varying(64),\n views varchar NOT NULL,\n cost decimal,\n stock_level text,\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "What are the timezone, address_line2, created_at of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, address_line2, created_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, address_line2, created_at FROM e-commerce.categories WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by timezone descending?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, address_line2, created_at FROM e-commerce.categories WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the title, expires_at, subcategory of each good?", "sql": null}, {"role": "assistant", "content": "SELECT title, expires_at, subcategory FROM government.goods;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT title, expires_at, subcategory FROM government.goods ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Tally up goods by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM government.goods GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.stores;", "sql": null}, {"role": "user", "content": "Sort the results by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.stores ORDER BY name ASC;", "sql": null}, {"role": "user", "content": "Get max of last_inspected by last_inspected from stores.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, MAX(last_inspected) AS max_last_inspected FROM government.stores GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "List api_key, bio, email from clients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, bio, email FROM government.clients;", "sql": null}, {"role": "user", "content": "Arrange the results with bio in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, bio, email FROM government.clients ORDER BY bio ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, bio, email FROM government.clients ORDER BY bio ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.clients;", "sql": null}, {"role": "user", "content": "Show me clients that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.clients WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.clients WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me accessibility, last_inspected, address_id for all stores.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, last_inspected, address_id FROM government.stores;", "sql": null}, {"role": "user", "content": "Order the output by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, last_inspected, address_id FROM government.stores ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Show me the count of stores grouped by address_id.", "sql": null}, {"role": "assistant", "content": "SELECT address_id, COUNT(*) AS count FROM government.stores GROUP BY address_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.stores;", "sql": null}, {"role": "user", "content": "Show me stores that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.stores WHERE last_inspected > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up stores by location_lon.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, COUNT(*) AS count FROM government.stores GROUP BY location_lon ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by expires_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY expires_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve last_inspected, location_lon, address_id for every store.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, address_id FROM government.stores;", "sql": null}, {"role": "user", "content": "Get all stores created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, address_id FROM government.stores WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of stores in each accessibility category.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM government.stores GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "List goods with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by stock_level for goods.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, MAX(created_at) AS max_created_at FROM government.goods GROUP BY stock_level;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n bio character varying(256),\n email text,\n website text,\n api_key char,\n age char NOT NULL,\n language text\n)\n\nCREATE TABLE government.stores (\n address_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n accessibility character varying(256),\n location_lon character varying(64) NOT NULL,\n name varchar\n)\n\nCREATE TABLE government.goods (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n stock_level char NOT NULL,\n title character varying(64),\n subcategory varchar,\n available character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods;", "sql": null}, {"role": "user", "content": "Order the output by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY subcategory DESC;", "sql": null}, {"role": "user", "content": "Order the output by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.goods ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Show me last_inspected, parking_available, accessibility for all events.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, parking_available, accessibility FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, parking_available, accessibility FROM socialmedia.events WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, parking_available, accessibility FROM socialmedia.events WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, accessibility, last_inspected of each event?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, accessibility, last_inspected FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List comment_id, state, published_at, reply_to_id for each event along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, accessibility, last_inspected, comments.published_at, comments.reply_to_id FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.id;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, accessibility, last_inspected, comments.published_at, comments.reply_to_id FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve parking_available, comment_id, last_inspected for every event.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, comment_id, last_inspected FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match latitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, comment_id, last_inspected FROM socialmedia.events WHERE latitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of accessibility by last_inspected from events.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, AVERAGE(accessibility) AS average_accessibility FROM socialmedia.events GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY comment_id ASC;", "sql": null}, {"role": "user", "content": "Show me sum of comment_id grouped by comment_id for followers.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, SUM(comment_id) AS sum_comment_id FROM socialmedia.followers GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve follower_id, state, accessibility for every event.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, state, accessibility FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get latitude, follower_id, body, published_at by joining events with comments.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, state, accessibility, comments.body, comments.published_at FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, state, accessibility, comments.body, comments.published_at FROM socialmedia.events JOIN socialmedia.comments ON events.comment_id = comments.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me event_id, published_at, accessibility, created_at from comments and their related events.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.accessibility, events.created_at FROM socialmedia.comments JOIN socialmedia.events ON comments.event_id = events.store_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.accessibility, events.created_at FROM socialmedia.comments JOIN socialmedia.events ON comments.event_id = events.store_id ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at date,\n operating_hours varchar,\n state character varying(256),\n latitude text,\n accessibility varchar,\n parking_available text,\n comment_id text -- reference to comments.id,\n follower_id text -- reference to followers.payment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(id),\n FOREIGN KEY (follower_id) REFERENCES followers(payment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n reply_to_id character varying(256),\n description character varying(128),\n parent_id text NOT NULL -- identifier for parent,\n body character varying(256) NOT NULL,\n event_id text NOT NULL -- reference to events.store_id,\n FOREIGN KEY (event_id) REFERENCES events(store_id)\n)\n\nCREATE TABLE socialmedia.followers (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n discount numeric,\n user_id character varying(256) -- identifier for user,\n price numeric NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "List price, processed_at, comment_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, comment_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, comment_id FROM socialmedia.followers WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up followers by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM socialmedia.followers GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.invoices (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n vendor_id char -- identifier for vendor,\n approval_status character varying(256),\n exchange_rate character varying(256) NOT NULL,\n user_id char -- identifier for user,\n customer_id char NOT NULL -- identifier for customer,\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE insurance.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n views character varying(128),\n likes character varying(256),\n description character varying(128),\n format character varying(64),\n score char NOT NULL,\n parent_id character varying(256),\n thumbnail character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n invoice_id text -- reference to invoices.id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id),\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)\n\nCREATE TABLE insurance.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(256) NOT NULL,\n type text,\n operating_hours character varying(64),\n coordinates char,\n name char,\n invoice_id text NOT NULL -- reference to invoices.id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews;", "sql": null}, {"role": "user", "content": "Sort the results by addresse_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews ORDER BY addresse_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by addresse_id.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, COUNT(*) AS count FROM insurance.reviews GROUP BY addresse_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.invoices (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n vendor_id char -- identifier for vendor,\n approval_status character varying(256),\n exchange_rate character varying(256) NOT NULL,\n user_id char -- identifier for user,\n customer_id char NOT NULL -- identifier for customer,\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE insurance.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n views character varying(128),\n likes character varying(256),\n description character varying(128),\n format character varying(64),\n score char NOT NULL,\n parent_id character varying(256),\n thumbnail character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n invoice_id text -- reference to invoices.id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id),\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)\n\nCREATE TABLE insurance.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(256) NOT NULL,\n type text,\n operating_hours character varying(64),\n coordinates char,\n name char,\n invoice_id text NOT NULL -- reference to invoices.id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews;", "sql": null}, {"role": "user", "content": "Get all reviews from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of reviews across different addresse_id values.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, COUNT(*) AS count FROM insurance.reviews GROUP BY addresse_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.invoices (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n vendor_id char -- identifier for vendor,\n approval_status character varying(256),\n exchange_rate character varying(256) NOT NULL,\n user_id char -- identifier for user,\n customer_id char NOT NULL -- identifier for customer,\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE insurance.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n views character varying(128),\n likes character varying(256),\n description character varying(128),\n format character varying(64),\n score char NOT NULL,\n parent_id character varying(256),\n thumbnail character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n invoice_id text -- reference to invoices.id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id),\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)\n\nCREATE TABLE insurance.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(256) NOT NULL,\n type text,\n operating_hours character varying(64),\n coordinates char,\n name char,\n invoice_id text NOT NULL -- reference to invoices.id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where parent_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews WHERE parent_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group reviews by likes and show the max of format.", "sql": null}, {"role": "assistant", "content": "SELECT likes, MAX(format) AS max_format FROM insurance.reviews GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.invoices (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n vendor_id char -- identifier for vendor,\n approval_status character varying(256),\n exchange_rate character varying(256) NOT NULL,\n user_id char -- identifier for user,\n customer_id char NOT NULL -- identifier for customer,\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE insurance.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n views character varying(128),\n likes character varying(256),\n description character varying(128),\n format character varying(64),\n score char NOT NULL,\n parent_id character varying(256),\n thumbnail character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n invoice_id text -- reference to invoices.id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id),\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)\n\nCREATE TABLE insurance.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(256) NOT NULL,\n type text,\n operating_hours character varying(64),\n coordinates char,\n name char,\n invoice_id text NOT NULL -- reference to invoices.id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where thumbnail LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reviews WHERE thumbnail LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of published_at grouped by likes for reviews.", "sql": null}, {"role": "assistant", "content": "SELECT likes, MIN(published_at) AS min_published_at FROM insurance.reviews GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.invoices (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n due_date date,\n vendor_id char -- identifier for vendor,\n approval_status character varying(256),\n exchange_rate character varying(256) NOT NULL,\n user_id char -- identifier for user,\n customer_id char NOT NULL -- identifier for customer,\n addresse_id text -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)\n\nCREATE TABLE insurance.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n views character varying(128),\n likes character varying(256),\n description character varying(128),\n format character varying(64),\n score char NOT NULL,\n parent_id character varying(256),\n thumbnail character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n invoice_id text -- reference to invoices.id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id),\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)\n\nCREATE TABLE insurance.addresses (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n parking_available character varying(256) NOT NULL,\n type text,\n operating_hours character varying(64),\n coordinates char,\n name char,\n invoice_id text NOT NULL -- reference to invoices.id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(id)\n)", "conversations": [{"role": "user", "content": "What are the addresse_id, published_at, views of each review?", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, published_at, views FROM insurance.reviews;", "sql": null}, {"role": "user", "content": "Order the output by likes ascending.", "sql": null}, {"role": "assistant", "content": "SELECT addresse_id, published_at, views FROM insurance.reviews ORDER BY likes ASC;", "sql": null}, {"role": "user", "content": "Group reviews by score and show the sum of thumbnail.", "sql": null}, {"role": "assistant", "content": "SELECT score, SUM(thumbnail) AS sum_thumbnail FROM insurance.reviews GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve website, updated_at, is_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT website, updated_at, is_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get all users created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT website, updated_at, is_active FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT website, updated_at, is_active FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "List verification_status, invoice_number, exchange_rate from events.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, exchange_rate FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get user_id, exchange_rate, updated_at, last_active by joining events with users.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, exchange_rate, users.updated_at, users.last_active FROM socialmedia.events JOIN socialmedia.users ON events.user_id = users.id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, exchange_rate, users.updated_at, users.last_active FROM socialmedia.events JOIN socialmedia.users ON events.user_id = users.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me website, last_active, is_active for all users.", "sql": null}, {"role": "assistant", "content": "SELECT website, last_active, is_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT website, last_active, is_active FROM socialmedia.users ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by last_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT website, last_active, is_active FROM socialmedia.users ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by debit ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY debit ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY debit ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve verification_status, debit, amount for every event.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, debit, amount FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get verification_status, payment_date, is_active, last_active by joining events with users.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, debit, amount, users.is_active, users.last_active FROM socialmedia.events JOIN socialmedia.users ON events.user_id = users.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, debit, amount, users.is_active, users.last_active FROM socialmedia.events JOIN socialmedia.users ON events.user_id = users.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me verification_status, payer_id, debit for all events.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, debit FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events with payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, debit FROM socialmedia.events WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payer_id, debit FROM socialmedia.events WHERE payment_date > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Tally up events by debit.", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM socialmedia.events GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve first_name, last_active, is_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_active, is_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Arrange the results with website in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_active, is_active FROM socialmedia.users ORDER BY website DESC;", "sql": null}, {"role": "user", "content": "What is the average last_active for each is_active in users?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, AVERAGE(last_active) AS average_last_active FROM socialmedia.users GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "List verification_status, payment_date, invoice_number from events.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payment_date, invoice_number FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, payment_date, invoice_number FROM socialmedia.events ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of events across different amount values.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM socialmedia.events GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n invoice_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n amount decimal,\n verification_status character varying(256),\n exchange_rate character varying(128),\n debit character varying(64) NOT NULL,\n payer_id character varying(256) -- identifier for payer,\n invoice_number character varying(64),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active date,\n is_active boolean,\n website varchar NOT NULL,\n first_name character varying(256) NOT NULL,\n event_id integer NOT NULL -- reference to events.invoice_id,\n FOREIGN KEY (event_id) REFERENCES events(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get last_active, updated_at, website from all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, website FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by is_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, website FROM socialmedia.users ORDER BY is_active ASC;", "sql": null}, {"role": "user", "content": "Sort the results by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, updated_at, website FROM socialmedia.users ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n created_at timestamp without time zone,\n website text NOT NULL,\n account_status character varying(256),\n full_name char NOT NULL,\n state text,\n password_hash text NOT NULL,\n course_id text -- reference to courses.account_id,\n enrollment_id text NOT NULL -- reference to enrollments.content_id,\n FOREIGN KEY (course_id) REFERENCES courses(account_id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(content_id)\n)\n\nCREATE TABLE education.enrollments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n visibility character varying(64) NOT NULL,\n title character varying(256),\n thumbnail char NOT NULL,\n parent_id text NOT NULL -- identifier for parent,\n shares text,\n course_id text NOT NULL -- reference to courses.account_id,\n FOREIGN KEY (course_id) REFERENCES courses(account_id)\n)\n\nCREATE TABLE education.grades (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(128) NOT NULL,\n subcategory character varying(128) NOT NULL\n)\n\nCREATE TABLE education.courses (\n account_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n updated_at date,\n customer_id char NOT NULL -- identifier for customer,\n amount decimal,\n debit char,\n payer_id varchar\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Sort the results by shares descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY shares DESC;", "sql": null}, {"role": "user", "content": "Get max of course_id by thumbnail from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, MAX(course_id) AS max_course_id FROM education.enrollments GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List title, brand, price, discount for each inventory along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.price, orders.discount FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.transaction_id;", "sql": null}, {"role": "user", "content": "How many inventory are there per id?", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM e-commerce.inventory GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of inventory grouped by id.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM e-commerce.inventory GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get brand, updated_at, available from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT brand, updated_at, available FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Order the output by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT brand, updated_at, available FROM e-commerce.inventory ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Get average of updated_at by title from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT title, AVERAGE(updated_at) AS average_updated_at FROM e-commerce.inventory GROUP BY title;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE available LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the expires_at, available, updated_at of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, updated_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, updated_at FROM e-commerce.inventory WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, updated_at FROM e-commerce.inventory WHERE title LIKE 'A%' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the brand, subcategory, updated_at of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT brand, subcategory, updated_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT brand, subcategory, updated_at FROM e-commerce.inventory ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Get average of available by expires_at from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, AVERAGE(available) AS average_available FROM e-commerce.inventory GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me subcategory, id, available for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, id, available FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, id, available FROM e-commerce.inventory WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, id, available FROM e-commerce.inventory WHERE title LIKE 'A%' ORDER BY subcategory DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me available, title, expires_at for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT available, title, expires_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Sort the results by order_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT available, title, expires_at FROM e-commerce.inventory ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different title values.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM e-commerce.inventory GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n discount decimal,\n price numeric(38,14),\n payment_method character varying(128)\n)\n\nCREATE TABLE e-commerce.shipping (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_status varchar,\n currency varchar,\n exchange_rate char NOT NULL,\n amount decimal\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n brand text NOT NULL,\n title character varying(64),\n available varchar,\n subcategory character varying(256),\n order_id integer -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve inventory where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up inventory by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.inventory GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Show me state, location_lon, store_id for all venues.", "sql": null}, {"role": "assistant", "content": "SELECT state, location_lon, store_id FROM library.venues;", "sql": null}, {"role": "user", "content": "List venues that have store_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT state, location_lon, store_id FROM library.venues WHERE store_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT state, location_lon, store_id FROM library.venues WHERE store_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "List store_id, updated_at, payment_id from venues.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, updated_at, payment_id FROM library.venues;", "sql": null}, {"role": "user", "content": "Find venues modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, updated_at, payment_id FROM library.venues WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, updated_at, payment_id FROM library.venues WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Display all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues;", "sql": null}, {"role": "user", "content": "Retrieve venues where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of venues across different location_lon values.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, COUNT(*) AS count FROM library.venues GROUP BY location_lon ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Get coordinates, location_lon, operating_hours from all venues.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, location_lon, operating_hours FROM library.venues;", "sql": null}, {"role": "user", "content": "Find venues where location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, location_lon, operating_hours FROM library.venues WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many venues are there per operating_hours?", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM library.venues GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Show me coordinates, operating_hours, updated_at for all venues.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, operating_hours, updated_at FROM library.venues;", "sql": null}, {"role": "user", "content": "Find venues where payment_id > 63.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, operating_hours, updated_at FROM library.venues WHERE payment_id > 63;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, operating_hours, updated_at FROM library.venues WHERE payment_id > 63 LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Get operating_hours, updated_at, location_lon from all venues.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, updated_at, location_lon FROM library.venues;", "sql": null}, {"role": "user", "content": "List venues that have operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, updated_at, location_lon FROM library.venues WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of venues in each coordinates category.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, COUNT(*) AS count FROM library.venues GROUP BY coordinates ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Display all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues;", "sql": null}, {"role": "user", "content": "Get all venues modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me max of operating_hours grouped by store_id for venues.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, MAX(operating_hours) AS max_operating_hours FROM library.venues GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "List accessibility, state, store_id from venues.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, state, store_id FROM library.venues;", "sql": null}, {"role": "user", "content": "List venues that have accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, state, store_id FROM library.venues WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of location_lon by updated_at from venues.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(location_lon) AS sum_location_lon FROM library.venues GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues;", "sql": null}, {"role": "user", "content": "Find venues where coordinates LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues WHERE coordinates LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of accessibility for each updated_at in venues.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(accessibility) AS min_accessibility FROM library.venues GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n operating_hours character varying(256) NOT NULL,\n accessibility varchar,\n state text,\n coordinates character varying(256),\n location_lon text,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE library.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n notes char,\n amount numeric,\n customer_id text NOT NULL -- identifier for customer\n)", "conversations": [{"role": "user", "content": "Retrieve all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues;", "sql": null}, {"role": "user", "content": "Can you order these by state descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.venues ORDER BY state DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of venues across different location_lon values.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, COUNT(*) AS count FROM library.venues GROUP BY location_lon ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Get all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Find categories where backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get max of price by rating from categories.", "sql": null}, {"role": "assistant", "content": "SELECT rating, MAX(price) AS max_price FROM e-commerce.categories GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Get rating, price, backorder from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT rating, price, backorder FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT rating, price, backorder FROM e-commerce.categories ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with backorder in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT rating, price, backorder FROM e-commerce.categories ORDER BY backorder ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Get id, price, rating from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT id, price, rating FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories that have backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, price, rating FROM e-commerce.categories WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT id, price, rating FROM e-commerce.categories WHERE backorder LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Show me expires_at, order_id, image_url for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, order_id, image_url FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, order_id, image_url FROM e-commerce.categories WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Group categories by image_url and show the sum of order_id.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, SUM(order_id) AS sum_order_id FROM e-commerce.categories GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "What are the id, price, image_url of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT id, price, image_url FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories with price > 51.", "sql": null}, {"role": "assistant", "content": "SELECT id, price, image_url FROM e-commerce.categories WHERE price > 51;", "sql": null}, {"role": "user", "content": "What is the count image_url for each rating in categories?", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(image_url) AS count_image_url FROM e-commerce.categories GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "What are the expires_at, id, price of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, id, price FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Find categories from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, id, price FROM e-commerce.categories WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the min expires_at for each id in categories?", "sql": null}, {"role": "assistant", "content": "SELECT id, MIN(expires_at) AS min_expires_at FROM e-commerce.categories GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "List expires_at, backorder, image_url from categories.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, backorder, image_url FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve categories where price > 72.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, backorder, image_url FROM e-commerce.categories WHERE price > 72;", "sql": null}, {"role": "user", "content": "Count the number of categories in each image_url category.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM e-commerce.categories GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Show me price, rating, backorder for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT price, rating, backorder FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Can you order these by backorder ascending?", "sql": null}, {"role": "assistant", "content": "SELECT price, rating, backorder FROM e-commerce.categories ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT price, rating, backorder FROM e-commerce.categories ORDER BY backorder ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Show me all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Find categories older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with rating in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY rating ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.categories (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n image_url varchar NOT NULL,\n rating character varying(256),\n price decimal NOT NULL,\n backorder character varying(128) NOT NULL,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate text NOT NULL,\n buyer_id text -- identifier for buyer,\n discount smallint\n)", "conversations": [{"role": "user", "content": "Get expires_at, price, id from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, id FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Retrieve categories where order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, id FROM e-commerce.categories WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, id FROM e-commerce.categories WHERE order_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, created_at, transaction_id for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, transaction_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, seller_id, approval_status, updated_at showing the relationship between audits and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, transaction_id, transactions.approval_status, transactions.updated_at FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id;", "sql": null}, {"role": "user", "content": "Group audits by approval_status and show the sum of approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(approval_status) AS sum_approval_status FROM finance.audits GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, updated_at, approval_status, currency showing the relationship between audits and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.approval_status, transactions.currency FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.approval_status, transactions.currency FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up audits by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM finance.audits GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve seller_id, approval_status, created_at for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, approval_status, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, approval_status, created_at FROM finance.audits WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, approval_status, created_at FROM finance.audits WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, transaction_id, created_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, transaction_id, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me created_at, approval_status, approval_status, amount from audits and their related transactions.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, transaction_id, created_at, transactions.approval_status, transactions.amount FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id;", "sql": null}, {"role": "user", "content": "Calculate average of delivery_status for each approval_status in audits.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, AVERAGE(delivery_status) AS average_delivery_status FROM finance.audits GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of audits across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM finance.audits GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve approval_status, delivery_status, updated_at, approval_status showing the relationship between audits and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.updated_at, transactions.approval_status FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.updated_at, transactions.approval_status FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "List created_at, transaction_id, delivery_status from audits.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, transaction_id, delivery_status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve delivery_status, updated_at, amount, updated_at showing the relationship between audits and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, transaction_id, delivery_status, transactions.amount, transactions.updated_at FROM finance.audits JOIN finance.transactions ON audits.transaction_id = transactions.invoice_id;", "sql": null}, {"role": "user", "content": "Count the number of audits in each seller_id category.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM finance.audits GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me transaction_id, created_at, approval_status for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, created_at, approval_status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits from last week.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, created_at, approval_status FROM finance.audits WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get min of transaction_id by created_at from audits.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(transaction_id) AS min_transaction_id FROM finance.audits GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n order_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n delivery_status character varying(64) NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n amount integer,\n currency text,\n approval_status character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the delivery_status, transaction_id, created_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, transaction_id, created_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by transaction_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, transaction_id, created_at FROM finance.audits ORDER BY transaction_id ASC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, transaction_id, created_at FROM finance.audits ORDER BY transaction_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many reviews are there per categories?", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM restaurant.reviews GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me keywords, inventor_id, parent_id for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, inventor_id, parent_id FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Order the output by parent_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, inventor_id, parent_id FROM restaurant.reviews ORDER BY parent_id ASC;", "sql": null}, {"role": "user", "content": "Group reviews by content_id and show the max of inventor_id.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, MAX(inventor_id) AS max_inventor_id FROM restaurant.reviews GROUP BY content_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many reviews are there per content_id?", "sql": null}, {"role": "assistant", "content": "SELECT content_id, COUNT(*) AS count FROM restaurant.reviews GROUP BY content_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the updated_at, inventor_id, categories of each review?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, inventor_id, categories FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Show me parent_id, content_id, reserved, thumbnail_url from reviews and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, inventor_id, categories, inventory.reserved, inventory.thumbnail_url FROM restaurant.reviews JOIN restaurant.inventory ON reviews.inventor_id = inventory.product_id;", "sql": null}, {"role": "user", "content": "What is the average inventor_id for each content_id in reviews?", "sql": null}, {"role": "assistant", "content": "SELECT content_id, AVERAGE(inventor_id) AS average_inventor_id FROM restaurant.reviews GROUP BY content_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Show me parent_id, categories, created_at, published_at from reviews and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.created_at, inventory.published_at FROM restaurant.reviews JOIN restaurant.inventory ON reviews.inventor_id = inventory.product_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.created_at, inventory.published_at FROM restaurant.reviews JOIN restaurant.inventory ON reviews.inventor_id = inventory.product_id ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get categories, keywords, updated_at from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT categories, keywords, updated_at FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by inventor_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT categories, keywords, updated_at FROM restaurant.reviews ORDER BY inventor_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by inventor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT categories, keywords, updated_at FROM restaurant.reviews ORDER BY inventor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match keywords LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE keywords LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by inventor_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE keywords LIKE 'A%' ORDER BY inventor_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with inventor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE inventor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with parent_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE inventor_id LIKE 'A%' ORDER BY parent_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.reviews (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n parent_id varchar NOT NULL,\n categories text,\n keywords character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)\n\nCREATE TABLE restaurant.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n views character varying(256),\n reserved character varying(256),\n featured_rank varchar NOT NULL,\n thumbnail_url character varying(128),\n rating character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with parent_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.reviews WHERE parent_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of categories for each categories in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT categories, MAX(categories) AS max_categories FROM restaurant.reviews GROUP BY categories;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve accessibility, subscription_id, timezone for every location.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, subscription_id, timezone FROM media.locations;", "sql": null}, {"role": "user", "content": "List locations that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, subscription_id, timezone FROM media.locations WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the count subscription_id for each accessibility in locations?", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(subscription_id) AS count_subscription_id FROM media.locations GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions;", "sql": null}, {"role": "user", "content": "Get subscriptions that match location_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions WHERE location_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions WHERE location_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.clients;", "sql": null}, {"role": "user", "content": "Get avatar, location_id, timezone, subscription_id by joining clients with locations.", "sql": null}, {"role": "assistant", "content": "SELECT *, locations.timezone, locations.subscription_id FROM media.clients JOIN media.locations ON clients.location_id = locations.address_id;", "sql": null}, {"role": "user", "content": "Order the output by avatar descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, locations.timezone, locations.subscription_id FROM media.clients JOIN media.locations ON clients.location_id = locations.address_id ORDER BY avatar DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the timezone, avatar, joined_at of each client?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, avatar, joined_at FROM media.clients;", "sql": null}, {"role": "user", "content": "Find clients where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, avatar, joined_at FROM media.clients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate max of timezone for each avatar in clients.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, MAX(timezone) AS max_timezone FROM media.clients GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, timezone, nationality for every client.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, timezone, nationality FROM media.clients;", "sql": null}, {"role": "user", "content": "List clients that have nationality LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, timezone, nationality FROM media.clients WHERE nationality LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, timezone, nationality FROM media.clients WHERE nationality LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get payer_id, client_id, due_date from all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, client_id, due_date FROM media.subscriptions;", "sql": null}, {"role": "user", "content": "Sort the results by payer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, client_id, due_date FROM media.subscriptions ORDER BY payer_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of subscriptions in each processed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM media.subscriptions GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the joined_at, nationality, timezone of each client?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, nationality, timezone FROM media.clients;", "sql": null}, {"role": "user", "content": "Sort the results by nationality ascending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, nationality, timezone FROM media.clients ORDER BY nationality ASC;", "sql": null}, {"role": "user", "content": "What is the min avatar for each timezone in clients?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MIN(avatar) AS min_avatar FROM media.clients GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions;", "sql": null}, {"role": "user", "content": "List payer_id, location_id, location_id, timezone for each subscription along with their client information.", "sql": null}, {"role": "assistant", "content": "SELECT *, clients.location_id, clients.timezone FROM media.subscriptions JOIN media.clients ON subscriptions.client_id = clients.user_id;", "sql": null}, {"role": "user", "content": "What is the count due_date for each processed_at in subscriptions?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(due_date) AS count_due_date FROM media.subscriptions GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions;", "sql": null}, {"role": "user", "content": "Show me subscriptions with user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.subscriptions WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of client_id grouped by user_id for subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(client_id) AS average_client_id FROM media.subscriptions GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n reconciliation_status character varying(256),\n user_id text,\n payer_id character varying(256),\n client_id integer NOT NULL -- reference to clients.user_id,\n location_id text NOT NULL -- reference to locations.address_id,\n FOREIGN KEY (client_id) REFERENCES clients(user_id),\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.clients (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n avatar character varying(128),\n timezone character varying(128) NOT NULL,\n nationality varchar NOT NULL,\n location_id text -- reference to locations.address_id,\n FOREIGN KEY (location_id) REFERENCES locations(address_id)\n)\n\nCREATE TABLE media.locations (\n address_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n address_line1 character varying(64) NOT NULL,\n accessibility character varying(64),\n category character varying(128),\n parking_available varchar NOT NULL,\n timezone varchar NOT NULL,\n subscription_id text NOT NULL -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get timezone, avatar, joined_at from all clients.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, avatar, joined_at FROM media.clients;", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, avatar, joined_at FROM media.clients ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, avatar, joined_at FROM media.clients ORDER BY timezone ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Sort the results by sku descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY sku DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List price, title, payment_status, approval_status for each group along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.payment_status, events.approval_status FROM socialmedia.groups JOIN socialmedia.events ON groups.event_id = events.order_id;", "sql": null}, {"role": "user", "content": "Show me sum of stock_level grouped by created_at for groups.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(stock_level) AS sum_stock_level FROM socialmedia.groups GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me groups with title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE title LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "What available, title, completed_at, status do we have for groups and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.completed_at, events.status FROM socialmedia.groups JOIN socialmedia.events ON groups.event_id = events.order_id;", "sql": null}, {"role": "user", "content": "Can you order these by sku ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.completed_at, events.status FROM socialmedia.groups JOIN socialmedia.events ON groups.event_id = events.order_id ORDER BY sku ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show the results sorted by event_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY event_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY event_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List available, stock_level, created_at from groups.", "sql": null}, {"role": "assistant", "content": "SELECT available, stock_level, created_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT available, stock_level, created_at FROM socialmedia.groups WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many groups are there per event_id?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, COUNT(*) AS count FROM socialmedia.groups GROUP BY event_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by stock_level ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY stock_level ASC;", "sql": null}, {"role": "user", "content": "How many groups are there per event_id?", "sql": null}, {"role": "assistant", "content": "SELECT event_id, COUNT(*) AS count FROM socialmedia.groups GROUP BY event_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve title, created_at, stock_level for every group.", "sql": null}, {"role": "assistant", "content": "SELECT title, created_at, stock_level FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me title, price, tax, payment_status from groups and their related events.", "sql": null}, {"role": "assistant", "content": "SELECT title, created_at, stock_level, events.tax, events.payment_status FROM socialmedia.groups JOIN socialmedia.events ON groups.event_id = events.order_id;", "sql": null}, {"role": "user", "content": "Order the output by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT title, created_at, stock_level, events.tax, events.payment_status FROM socialmedia.groups JOIN socialmedia.events ON groups.event_id = events.order_id ORDER BY available DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at date,\n quantity varchar NOT NULL,\n price integer NOT NULL,\n stock_level character varying(256) NOT NULL,\n available character varying(64),\n title varchar,\n event_id integer NOT NULL -- reference to events.order_id,\n FOREIGN KEY (event_id) REFERENCES events(order_id)\n)\n\nCREATE TABLE socialmedia.events (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n tax smallint,\n payment_method character varying(64),\n payment_status text NOT NULL,\n user_id character varying(128) NOT NULL,\n status varchar,\n approval_status character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me title, event_id, quantity for all groups.", "sql": null}, {"role": "assistant", "content": "SELECT title, event_id, quantity FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get groups that match event_id > 29.", "sql": null}, {"role": "assistant", "content": "SELECT title, event_id, quantity FROM socialmedia.groups WHERE event_id > 29;", "sql": null}, {"role": "user", "content": "Show me min of stock_level grouped by created_at for groups.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(stock_level) AS min_stock_level FROM socialmedia.groups GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many followers are there per notes?", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM socialmedia.followers GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE payment_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of followers in each group_id category.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY group_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Can you order these by author_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY author_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by author_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve groups where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE media_url LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n currency varchar,\n notes character varying(128) NOT NULL,\n description varchar NOT NULL,\n verification_status character varying(256) NOT NULL,\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n tags varchar,\n text character varying(128) NOT NULL,\n author_id char -- identifier for author,\n subject char NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n subject character varying(128),\n attachment_url character varying(128) NOT NULL,\n author_id char,\n title character varying(128),\n group_id integer NOT NULL -- reference to groups.product_id,\n FOREIGN KEY (group_id) REFERENCES groups(product_id)\n)\n\nCREATE TABLE socialmedia.groups (\n product_id integer PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n rating character varying(256),\n video_url character varying(64) -- identifier for video_url,\n media_url character varying(256),\n quantity character varying(128),\n available character varying(128),\n comment_id text -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE media_url LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, price, user_id from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, price, user_id FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, price, user_id FROM tradingplatform.metadata ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, price, user_id FROM tradingplatform.metadata ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve wallet_id, full_name, last_name for every user.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, full_name, last_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by avatar descending.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, full_name, last_name FROM tradingplatform.users ORDER BY avatar DESC;", "sql": null}, {"role": "user", "content": "What is the min avatar for each birth_date in users?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, MIN(avatar) AS min_avatar FROM tradingplatform.users GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve rating, popularity_score, updated_at for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT rating, popularity_score, updated_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Arrange the results with wallet_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT rating, popularity_score, updated_at FROM tradingplatform.metadata ORDER BY wallet_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, popularity_score, updated_at FROM tradingplatform.metadata ORDER BY popularity_score DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "What are the due_date, metadat_id, status of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, metadat_id, status FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by metadat_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, metadat_id, status FROM tradingplatform.wallets ORDER BY metadat_id ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, metadat_id, status FROM tradingplatform.wallets ORDER BY metadat_id ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "What are the description, metadat_id, updated_at of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT description, metadat_id, updated_at FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me wallets with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT description, metadat_id, updated_at FROM tradingplatform.wallets WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me max of reconciliation_status grouped by due_date for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, MAX(reconciliation_status) AS max_reconciliation_status FROM tradingplatform.wallets GROUP BY due_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with popularity_score in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY popularity_score ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp,\n invoice_number character varying(128),\n reconciliation_status text,\n status character varying(64) NOT NULL,\n description varchar NOT NULL,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n avatar character varying(256),\n last_name character varying(64) NOT NULL,\n birth_date date,\n full_name character varying(64),\n wallet_id text -- reference to wallets.account_id,\n metadat_id integer -- reference to metadata.sku,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)\n\nCREATE TABLE tradingplatform.metadata (\n sku integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating char,\n popularity_score char,\n description text,\n discount numeric(38,14),\n price numeric NOT NULL,\n user_id text NOT NULL -- reference to users.id,\n wallet_id text -- reference to wallets.account_id,\n FOREIGN KEY (user_id) REFERENCES users(id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List due_date, status, metadat_id from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, status, metadat_id FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, status, metadat_id FROM tradingplatform.wallets WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get average of description by reconciliation_status from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, AVERAGE(description) AS average_description FROM tradingplatform.wallets GROUP BY reconciliation_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Retrieve address_line2, name, updated_at for every event.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, name, updated_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, name, updated_at FROM socialmedia.events WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of events in each message_id category.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.events GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up events by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.events GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Get name, address_line2, geo_point from all events.", "sql": null}, {"role": "assistant", "content": "SELECT name, address_line2, geo_point FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT name, address_line2, geo_point FROM socialmedia.events WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT name, address_line2, geo_point FROM socialmedia.events WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What geo_point, address_line2, reply_to_id, content do we have for events and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.reply_to_id, messages.content FROM socialmedia.events JOIN socialmedia.messages ON events.message_id = messages.content_id;", "sql": null}, {"role": "user", "content": "Tally up events by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.events GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve likes where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of likes across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.likes GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "What are the name, message_id, address_line2 of each event?", "sql": null}, {"role": "assistant", "content": "SELECT name, message_id, address_line2 FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get all events created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT name, message_id, address_line2 FROM socialmedia.events WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of name for each name in events.", "sql": null}, {"role": "assistant", "content": "SELECT name, MIN(name) AS min_name FROM socialmedia.events GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY address_line2 ASC;", "sql": null}, {"role": "user", "content": "How many events are there per geo_point?", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM socialmedia.events GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "List media_url, message_id, visibility from likes.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, message_id, visibility FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show me likes with edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, message_id, visibility FROM socialmedia.likes WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, message_id, visibility FROM socialmedia.likes WHERE edited_at > '2023-01-01' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Show me message_id, geo_point, updated_at for all events.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, geo_point, updated_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Order the output by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, geo_point, updated_at FROM socialmedia.events ORDER BY address_line2 ASC;", "sql": null}, {"role": "user", "content": "Calculate count of geo_point for each updated_at in events.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(geo_point) AS count_geo_point FROM socialmedia.events GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n name text,\n geo_point character varying(64) NOT NULL,\n address_line2 character varying(64) NOT NULL,\n message_id text -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.likes (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n keywords character varying(64) NOT NULL,\n media_url varchar,\n visibility text NOT NULL,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE socialmedia.messages (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp without time zone,\n description character varying(256),\n author_id text -- identifier for author,\n reply_to_id char -- identifier for reply_to,\n keywords char,\n content char\n)\n\nCREATE TABLE socialmedia.comments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n edited_at date,\n subject varchar,\n reply_to_id character varying(64) NOT NULL,\n author_id character varying(64) -- identifier for author,\n thumbnail text\n)", "conversations": [{"role": "user", "content": "Get created_at, keywords, media_url from all likes.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, keywords, media_url FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve likes where message_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, keywords, media_url FROM socialmedia.likes WHERE message_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, keywords, media_url FROM socialmedia.likes WHERE message_id LIKE 'A%' ORDER BY media_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Order the output by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by categorie_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping ORDER BY categorie_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Show me tax_rate, featured_rank, published_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, featured_rank, published_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, featured_rank, published_at FROM e-commerce.shipping WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of shipping in each reserved category.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM e-commerce.shipping GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "List expires_at, published_at, categorie_id from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, published_at, categorie_id FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have tax_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, published_at, categorie_id FROM e-commerce.shipping WHERE tax_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of published_at by expires_at from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, SUM(published_at) AS sum_published_at FROM e-commerce.shipping GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "List tax_rate, featured_rank, expires_at from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, featured_rank, expires_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me expires_at, tax_rate, visibility, shares from shipping and their related categories.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, featured_rank, expires_at, categories.visibility, categories.shares FROM e-commerce.shipping JOIN e-commerce.categories ON shipping.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Group shipping by reserved and show the sum of expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, SUM(expires_at) AS sum_expires_at FROM e-commerce.shipping GROUP BY reserved;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with categorie_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE categorie_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE categorie_id LIKE 'A%' ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with tax_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY tax_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group shipping by expires_at and show the average of featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, AVERAGE(featured_rank) AS average_featured_rank FROM e-commerce.shipping GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Show me featured_rank, reserved, published_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, reserved, published_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, reserved, published_at FROM e-commerce.shipping WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of published_at by categorie_id from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, MIN(published_at) AS min_published_at FROM e-commerce.shipping GROUP BY categorie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp,\n tax_rate text,\n reserved character varying(128) NOT NULL,\n featured_rank character varying(256),\n categorie_id text NOT NULL -- reference to categories.post_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(post_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n rating text NOT NULL,\n video_url char -- identifier for video_url,\n views character varying(64)\n)\n\nCREATE TABLE e-commerce.categories (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n content character varying(128),\n parent_id character varying(256),\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n shares character varying(256),\n format character varying(256),\n visibility text\n)", "conversations": [{"role": "user", "content": "Retrieve reserved, tax_rate, published_at for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, tax_rate, published_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve expires_at, featured_rank, parent_id, shares showing the relationship between shipping and categories.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, tax_rate, published_at, categories.parent_id, categories.shares FROM e-commerce.shipping JOIN e-commerce.categories ON shipping.categorie_id = categories.post_id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, tax_rate, published_at, categories.parent_id, categories.shares FROM e-commerce.shipping JOIN e-commerce.categories ON shipping.categorie_id = categories.post_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales;", "sql": null}, {"role": "user", "content": "Get sales that match seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of seller_id for each student_id in sales.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, MAX(seller_id) AS max_seller_id FROM retail.sales GROUP BY student_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.facilities;", "sql": null}, {"role": "user", "content": "Sort the results by sale_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.facilities ORDER BY sale_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.facilities ORDER BY sale_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.students;", "sql": null}, {"role": "user", "content": "Find students where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.students WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.students WHERE created_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales;", "sql": null}, {"role": "user", "content": "Get sales that match facilitie_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales WHERE facilitie_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of facilitie_id for each fee in sales.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(facilitie_id) AS count_facilitie_id FROM retail.sales GROUP BY fee;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me last_inspected, latitude, description for all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, latitude, description FROM retail.facilities;", "sql": null}, {"role": "user", "content": "Arrange the results with location_lat in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, latitude, description FROM retail.facilities ORDER BY location_lat ASC;", "sql": null}, {"role": "user", "content": "Order the output by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, latitude, description FROM retail.facilities ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.students;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.students ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different gender values.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM retail.students GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "Get student_id, processed_at, payment_method from all sales.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, processed_at, payment_method FROM retail.sales;", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, processed_at, payment_method FROM retail.sales ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "How many sales are there per seller_id?", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM retail.sales GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "List all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.facilities;", "sql": null}, {"role": "user", "content": "Show the results sorted by sale_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.facilities ORDER BY sale_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of facilities grouped by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM retail.facilities GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.facilities (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n description character varying(64),\n location_lat character varying(64),\n street varchar,\n latitude varchar NOT NULL,\n postal_code char NOT NULL,\n timezone text NOT NULL,\n longitude character varying(64) NOT NULL,\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n email char,\n gender char,\n membership_level varchar,\n bio character varying(128),\n timezone character varying(64),\n sale_id text NOT NULL -- reference to sales.transaction_id,\n FOREIGN KEY (sale_id) REFERENCES sales(transaction_id)\n)\n\nCREATE TABLE retail.sales (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n seller_id character varying(128),\n payment_method character varying(256) NOT NULL,\n fee character varying(64),\n facilitie_id text -- reference to facilities.location_id,\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(location_id),\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales;", "sql": null}, {"role": "user", "content": "Order the output by payment_method descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.sales ORDER BY payment_method DESC;", "sql": null}, {"role": "user", "content": "Show me sum of seller_id grouped by facilitie_id for sales.", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, SUM(seller_id) AS sum_seller_id FROM retail.sales GROUP BY facilitie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me id, first_name, token for all users.", "sql": null}, {"role": "assistant", "content": "SELECT id, first_name, token FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Arrange the results with full_name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT id, first_name, token FROM tradingplatform.users ORDER BY full_name DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by state ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, first_name, token FROM tradingplatform.users ORDER BY state ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve full_name, order_id, state for every user.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, order_id, state FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List id, order_id, discount, subtotal for each user along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, order_id, state, orders.discount, orders.subtotal FROM tradingplatform.users JOIN tradingplatform.orders ON users.order_id = orders.order_id;", "sql": null}, {"role": "user", "content": "Show me sum of timezone grouped by timezone for users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, SUM(timezone) AS sum_timezone FROM tradingplatform.users GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users where state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE state LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "What updated_at, order_id, discount, subtotal do we have for users and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.discount, orders.subtotal FROM tradingplatform.users JOIN tradingplatform.orders ON users.order_id = orders.order_id;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.discount, orders.subtotal FROM tradingplatform.users JOIN tradingplatform.orders ON users.order_id = orders.order_id ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me full_name, updated_at, token for all users.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, token FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Can you order these by token ascending?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, token FROM tradingplatform.users ORDER BY token ASC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, updated_at, token FROM tradingplatform.users ORDER BY token ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get all users between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by order_id.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(*) AS count FROM tradingplatform.users GROUP BY order_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get token, order_id, id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT token, order_id, id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List token, order_id, buyer_id, subtotal for each user along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT token, order_id, id, orders.buyer_id, orders.subtotal FROM tradingplatform.users JOIN tradingplatform.orders ON users.order_id = orders.order_id;", "sql": null}, {"role": "user", "content": "Get min of first_name by timezone from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MIN(first_name) AS min_first_name FROM tradingplatform.users GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me first_name, token, subtotal, buyer_id from users and their related orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.subtotal, orders.buyer_id FROM tradingplatform.users JOIN tradingplatform.orders ON users.order_id = orders.order_id;", "sql": null}, {"role": "user", "content": "Group users by order_id and show the min of first_name.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, MIN(first_name) AS min_first_name FROM tradingplatform.users GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal numeric(38,14),\n buyer_id varchar,\n discount integer NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n first_name char NOT NULL,\n full_name character varying(128),\n state varchar,\n timezone character varying(256) NOT NULL,\n token text NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different full_name values.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.patients;", "sql": null}, {"role": "user", "content": "List patients that have last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.patients WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many patients are there per purchase_id?", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, COUNT(*) AS count FROM travel.patients GROUP BY purchase_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Arrange the results with cancelled_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY cancelled_at DESC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY cancelled_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the name, purchase_id, created_at of each store?", "sql": null}, {"role": "assistant", "content": "SELECT name, purchase_id, created_at FROM travel.stores;", "sql": null}, {"role": "user", "content": "Show me stores that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT name, purchase_id, created_at FROM travel.stores WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT name, purchase_id, created_at FROM travel.stores WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "List approval_status, status, cancelled_at from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, cancelled_at FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Show me patient_id, cancelled_at, purchase_id, last_name from purchases and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, cancelled_at, patients.purchase_id, patients.last_name FROM travel.purchases JOIN travel.patients ON purchases.patient_id = patients.person_id;", "sql": null}, {"role": "user", "content": "How many purchases are there per subtotal?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM travel.purchases GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Show me patient_id, approval_status, updated_at, last_name from purchases and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.updated_at, patients.last_name FROM travel.purchases JOIN travel.patients ON purchases.patient_id = patients.person_id;", "sql": null}, {"role": "user", "content": "Get the distribution of purchases across different patient_id values.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM travel.purchases GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "List token, purchase_id, last_name from patients.", "sql": null}, {"role": "assistant", "content": "SELECT token, purchase_id, last_name FROM travel.patients;", "sql": null}, {"role": "user", "content": "Get all patients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT token, purchase_id, last_name FROM travel.patients WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT token, purchase_id, last_name FROM travel.patients WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.stores;", "sql": null}, {"role": "user", "content": "Show me purchase_id, location_id, subtotal, approval_status from stores and their related purchases.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.subtotal, purchases.approval_status FROM travel.stores JOIN travel.purchases ON stores.purchase_id = purchases.invoice_id;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.subtotal, purchases.approval_status FROM travel.stores JOIN travel.purchases ON stores.purchase_id = purchases.invoice_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Get all purchases modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "List payment_method, approval_status, status from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, approval_status, status FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Order the output by patient_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, approval_status, status FROM travel.purchases ORDER BY patient_id ASC;", "sql": null}, {"role": "user", "content": "Calculate min of approval_status for each currency in purchases.", "sql": null}, {"role": "assistant", "content": "SELECT currency, MIN(approval_status) AS min_approval_status FROM travel.purchases GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n invoice_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n approval_status character varying(64),\n payment_method char,\n status character varying(128),\n subtotal numeric(38,14) NOT NULL,\n product_id character varying(128),\n currency char,\n patient_id text -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE travel.stores (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_inspected timestamp without time zone,\n capacity character varying(64) NOT NULL,\n description text,\n name text NOT NULL,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)\n\nCREATE TABLE travel.patients (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status text,\n token char NOT NULL,\n last_name character varying(128) NOT NULL,\n country char,\n purchase_id text -- reference to purchases.invoice_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.patients;", "sql": null}, {"role": "user", "content": "Can you order these by purchase_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.patients ORDER BY purchase_id ASC;", "sql": null}, {"role": "user", "content": "Get count of token by status from patients.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(token) AS count_token FROM travel.patients GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Order the output by order_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Sort the results by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues ORDER BY address_line2 ASC;", "sql": null}, {"role": "user", "content": "How many venues are there per parking_available?", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM travel.venues GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me city, password_hash, timezone for all students.", "sql": null}, {"role": "assistant", "content": "SELECT city, password_hash, timezone FROM travel.students;", "sql": null}, {"role": "user", "content": "List students with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT city, password_hash, timezone FROM travel.students WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT city, password_hash, timezone FROM travel.students WHERE joined_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List card_type, order_id, status from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, order_id, status FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, order_id, status FROM travel.purchases ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Group purchases by updated_at and show the average of status.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(status) AS average_status FROM travel.purchases GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Sort the results by store_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues ORDER BY store_id DESC;", "sql": null}, {"role": "user", "content": "Group venues by accessibility and show the average of address_line1.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, AVERAGE(address_line1) AS average_address_line1 FROM travel.venues GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List timezone, last_active, password_hash from students.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_active, password_hash FROM travel.students;", "sql": null}, {"role": "user", "content": "List students that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_active, password_hash FROM travel.students WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up students by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM travel.students GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Get venues that match address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues WHERE address_line2 LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me city, parking_available, store_id for all venues.", "sql": null}, {"role": "assistant", "content": "SELECT city, parking_available, store_id FROM travel.venues;", "sql": null}, {"role": "user", "content": "Find venues between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT city, parking_available, store_id FROM travel.venues WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT city, parking_available, store_id FROM travel.venues WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Retrieve students where timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group students by joined_at and show the max of password_hash.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(password_hash) AS max_password_hash FROM travel.students GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n city character varying(128),\n address_line1 character varying(256),\n coordinates character varying(256),\n address_line2 character varying(64) NOT NULL,\n accessibility character varying(128),\n parking_available char\n)\n\nCREATE TABLE travel.purchases (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n status character varying(128),\n amount integer,\n card_type character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n timezone char,\n password_hash character varying(64) NOT NULL,\n city character varying(64)\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Retrieve students where password_hash LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE password_hash LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by joined_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE password_hash LIKE 'A%' ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp without time zone,\n age character varying(128),\n display_name character varying(128),\n timezone varchar,\n city character varying(64),\n avatar character varying(128) NOT NULL,\n account_id text NOT NULL -- reference to accounts.payment_id,\n FOREIGN KEY (account_id) REFERENCES accounts(payment_id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n reconciliation_status character varying(64),\n invoice_number text,\n loan_id integer NOT NULL -- reference to loans.id,\n FOREIGN KEY (loan_id) REFERENCES loans(id)\n)\n\nCREATE TABLE finance.audits (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at date,\n bio character varying(256),\n timezone text,\n first_name character varying(64),\n website character varying(128),\n last_login date,\n loan_id integer NOT NULL -- reference to loans.id,\n account_id text NOT NULL -- reference to accounts.payment_id,\n FOREIGN KEY (loan_id) REFERENCES loans(id),\n FOREIGN KEY (account_id) REFERENCES accounts(payment_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n updated_at timestamp without time zone,\n is_verified bit,\n bio character varying(128),\n last_name char,\n status character varying(128),\n last_login timestamp NOT NULL,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE last_login >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE last_login >= CURRENT_DATE - INTERVAL '7 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Show me full_name, nationality, is_verified for all users.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, nationality, is_verified FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get users that match full_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, nationality, is_verified FROM socialmedia.users WHERE full_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up users by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.users GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by is_verified descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY is_verified DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What comment_id, last_active, attachment_url, body do we have for users and their associated comments?", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.attachment_url, comments.body FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.attachment_url, comments.body FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Get comment_id, last_active, profile_picture_url from all users.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, last_active, profile_picture_url FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, last_active, profile_picture_url FROM socialmedia.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me min of profile_picture_url grouped by bio for users.", "sql": null}, {"role": "assistant", "content": "SELECT bio, MIN(profile_picture_url) AS min_profile_picture_url FROM socialmedia.users GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Get comment_id, subject, edited_at from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, subject, edited_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve subject, categories, body, user_id showing the relationship between posts and comments.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, subject, edited_at, comments.body, comments.user_id FROM socialmedia.posts JOIN socialmedia.comments ON posts.comment_id = comments.id;", "sql": null}, {"role": "user", "content": "Tally up posts by views.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM socialmedia.posts GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "List published_at, edited_at, views from posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, edited_at, views FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, edited_at, views FROM socialmedia.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, edited_at, views FROM socialmedia.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "Get comment_id, edited_at, categories from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, edited_at, categories FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show the results sorted by categories ascending.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, edited_at, categories FROM socialmedia.posts ORDER BY categories ASC;", "sql": null}, {"role": "user", "content": "Tally up posts by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.posts GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "What are the is_verified, nationality, comment_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, nationality, comment_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, nationality, comment_id FROM socialmedia.users WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many users are there per comment_id?", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.users GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n media_url character varying(256),\n format character varying(64) NOT NULL,\n title character varying(64)\n)\n\nCREATE TABLE socialmedia.comments (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n body char,\n user_id character varying(128),\n attachment_url character varying(256)\n)\n\nCREATE TABLE socialmedia.users (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n full_name char,\n nationality character varying(256) NOT NULL,\n bio character varying(128),\n is_verified boolean NOT NULL -- indicates if verified is true,\n profile_picture_url varchar NOT NULL,\n age character varying(128) NOT NULL,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n likes character varying(64),\n thumbnail character varying(128) NOT NULL,\n categories char,\n subject character varying(256) NOT NULL,\n views text,\n comment_id text NOT NULL -- reference to comments.id,\n FOREIGN KEY (comment_id) REFERENCES comments(id)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by comment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY comment_id DESC;", "sql": null}, {"role": "user", "content": "Tally up posts by categories.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM socialmedia.posts GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Show me updated_at, trade_id, card_type for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, trade_id, card_type FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, trade_id, card_type FROM tradingplatform.notifications WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of notifications in each currency category.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get all notifications from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by trade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY trade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "What are the approval_status, updated_at, currency of each notification?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, currency FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, currency FROM tradingplatform.notifications WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, currency FROM tradingplatform.notifications WHERE trade_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE seller_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "List approval_status, card_type, seller_id from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, card_type, seller_id FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, card_type, seller_id FROM tradingplatform.notifications WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up notifications by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "List approval_status, updated_at, card_type from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, card_type FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications that have approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, card_type FROM tradingplatform.notifications WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many notifications are there per approval_status?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate sum of approval_status for each approval_status in notifications.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, SUM(approval_status) AS sum_approval_status FROM tradingplatform.notifications GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get all notifications from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n currency text,\n card_type text,\n seller_id character varying(64) NOT NULL -- identifier for seller,\n approval_status character varying(64) NOT NULL,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at date,\n status character varying(64),\n subtotal numeric(38,14),\n tax integer,\n exchange_rate text,\n payment_status character varying(128) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me approval_status, seller_id, subtotal, processed_at from notifications and their related trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.subtotal, trades.processed_at FROM tradingplatform.notifications JOIN tradingplatform.trades ON notifications.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "Tally up notifications by currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "What is the sum categories for each score in departments?", "sql": null}, {"role": "assistant", "content": "SELECT score, SUM(categories) AS sum_categories FROM healthcare.departments GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where medical_record_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE medical_record_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by billin_id.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, COUNT(*) AS count FROM healthcare.departments GROUP BY billin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each patient_id category.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM healthcare.medical_records GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get created_at, image_url, categories from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, categories FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with billin_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, categories FROM healthcare.departments ORDER BY billin_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by tags ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, categories FROM healthcare.departments ORDER BY tags ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Can you order these by image_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Show me average of medical_record_id grouped by score for departments.", "sql": null}, {"role": "assistant", "content": "SELECT score, AVERAGE(medical_record_id) AS average_medical_record_id FROM healthcare.departments GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me score, image_url, tags for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT score, image_url, tags FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT score, image_url, tags FROM healthcare.departments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate min of categories for each tags in departments.", "sql": null}, {"role": "assistant", "content": "SELECT tags, MIN(categories) AS min_categories FROM healthcare.departments GROUP BY tags;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.departments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List payee_id, currency, patient_id from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, currency, patient_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records with exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, currency, patient_id FROM healthcare.medical_records WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, currency, patient_id FROM healthcare.medical_records WHERE exchange_rate LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n currency varchar,\n payee_id character varying(128),\n exchange_rate character varying(256) NOT NULL,\n verification_status character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n created_at timestamp,\n status character varying(128) NOT NULL,\n salt text,\n avatar character varying(256),\n full_name text\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n accessibility char,\n parking_available character varying(64),\n state character varying(256)\n)\n\nCREATE TABLE healthcare.departments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n image_url character varying(64) NOT NULL,\n score char,\n categories character varying(128),\n tags character varying(256),\n medical_record_id text -- reference to medical_records.payment_id,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(payment_id),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "List media_url, views, parent_id from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, views, parent_id FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, views, parent_id FROM transportation.reviews ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Group reviews by product_id and show the count of parent_id.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(parent_id) AS count_parent_id FROM transportation.reviews GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get count of edited_at by media_url from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(edited_at) AS count_edited_at FROM transportation.reviews GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me edited_at, product_id, tags for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, product_id, tags FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Show me parent_id, edited_at, description, published_at from reviews and their related products.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, product_id, tags, products.description, products.published_at FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Can you order these by parent_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, product_id, tags, products.description, products.published_at FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku ORDER BY parent_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Get views, product_id, edited_at from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT views, product_id, edited_at FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "List tags, product_id, tax_rate, views for each review along with their product information.", "sql": null}, {"role": "assistant", "content": "SELECT views, product_id, edited_at, products.tax_rate, products.views FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Calculate max of product_id for each media_url in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MAX(product_id) AS max_product_id FROM transportation.reviews GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "List views, product_id, edited_at from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT views, product_id, edited_at FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Get parent_id, views, currency, published_at by joining reviews with products.", "sql": null}, {"role": "assistant", "content": "SELECT views, product_id, edited_at, products.currency, products.published_at FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Tally up reviews by views.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM transportation.reviews GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "List media_url, edited_at, views from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, edited_at, views FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "What product_id, tags, published_at, popularity_score do we have for reviews and their associated products?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, edited_at, views, products.published_at, products.popularity_score FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku;", "sql": null}, {"role": "user", "content": "Order the output by views ascending.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, edited_at, views, products.published_at, products.popularity_score FROM transportation.reviews JOIN transportation.products ON reviews.product_id = products.sku ORDER BY views ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "List tags, subject, parent_id from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT tags, subject, parent_id FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT tags, subject, parent_id FROM transportation.reviews ORDER BY views DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of reviews across different product_id values.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM transportation.reviews GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Find reviews from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY edited_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.reviews WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.reviews (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n parent_id varchar,\n media_url char,\n subject char NOT NULL,\n views character varying(256) NOT NULL,\n tags character varying(128),\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE transportation.products (\n sku text PRIMARY KEY -- unique identifier,\n published_at date,\n popularity_score character varying(128),\n views character varying(64) NOT NULL,\n description character varying(256),\n currency varchar NOT NULL,\n tax_rate varchar NOT NULL\n)\n\nCREATE TABLE transportation.stores (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n geo_point character varying(128),\n street varchar,\n longitude char NOT NULL,\n coordinates character varying(64),\n capacity character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve edited_at, subject, media_url for every review.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, subject, media_url FROM transportation.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by tags ascending.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, subject, media_url FROM transportation.reviews ORDER BY tags ASC;", "sql": null}, {"role": "user", "content": "Count the number of reviews in each parent_id category.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, COUNT(*) AS count FROM transportation.reviews GROUP BY parent_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Retrieve media_url, price, image_url for every good.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, price, image_url FROM retail.goods;", "sql": null}, {"role": "user", "content": "List media_url, created_at, zip_code, updated_at for each good along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, price, image_url, patients.zip_code, patients.updated_at FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Get max of created_at by patient_id from goods.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, MAX(created_at) AS max_created_at FROM retail.goods GROUP BY patient_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "What are the image_url, patient_id, media_url of each good?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, patient_id, media_url FROM retail.goods;", "sql": null}, {"role": "user", "content": "Show me created_at, media_url, city, age from goods and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, patient_id, media_url, patients.city, patients.age FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, patient_id, media_url, patients.city, patients.age FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "Show me created_at, media_url, website, age from goods and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.website, patients.age FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.website, patients.age FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Get all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "Find goods from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me min of created_at grouped by updated_at for goods.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(created_at) AS min_created_at FROM retail.goods GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Retrieve all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "Get all goods from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "What is the average image_url for each patient_id in goods?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, AVERAGE(image_url) AS average_image_url FROM retail.goods GROUP BY patient_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "List all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "List goods that have price > 21.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE price > 21;", "sql": null}, {"role": "user", "content": "Show me the count of goods grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM retail.goods GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Retrieve all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "Retrieve goods where price > 58.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE price > 58;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE price > 58 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "What are the media_url, image_url, patient_id of each good?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, image_url, patient_id FROM retail.goods;", "sql": null}, {"role": "user", "content": "Find goods where product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, image_url, patient_id FROM retail.goods WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up goods by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM retail.goods GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "Show me all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods;", "sql": null}, {"role": "user", "content": "Show me goods with media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.goods WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of patient_id for each media_url in goods.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MIN(patient_id) AS min_patient_id FROM retail.goods GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.goods (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n media_url text NOT NULL,\n price numeric(38,14),\n image_url character varying(256),\n patient_id integer NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE retail.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status varchar,\n status text\n)\n\nCREATE TABLE retail.addresses (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n location_lat character varying(256) NOT NULL,\n accessibility character varying(256),\n operating_hours varchar,\n parking_available char,\n postal_code varchar\n)\n\nCREATE TABLE retail.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n address character varying(64),\n age varchar,\n zip_code character varying(128),\n website character varying(256),\n city char\n)", "conversations": [{"role": "user", "content": "List patient_id, product_id, image_url from goods.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, product_id, image_url FROM retail.goods;", "sql": null}, {"role": "user", "content": "Show me patient_id, media_url, city, address from goods and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, product_id, image_url, patients.city, patients.address FROM retail.goods JOIN retail.patients ON goods.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "How many goods are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM retail.goods GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n created_at date,\n message character varying(128),\n shares character varying(256) NOT NULL,\n visibility character varying(64),\n score character varying(128),\n thumbnail character varying(256) NOT NULL,\n image_url character varying(128),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n type varchar,\n operating_hours character varying(64),\n accessibility character varying(64),\n location_lat character varying(64)\n)\n\nCREATE TABLE marketing.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n website text NOT NULL,\n account_status varchar,\n api_key character varying(256) NOT NULL,\n facilitie_id integer -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n stock_level varchar,\n currency char NOT NULL,\n available char,\n thumbnail_url character varying(256),\n msrp text,\n featured_rank character varying(256) NOT NULL,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students;", "sql": null}, {"role": "user", "content": "Sort the results by website ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY website ASC;", "sql": null}, {"role": "user", "content": "Sort the results by facilitie_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY facilitie_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n created_at date,\n message character varying(128),\n shares character varying(256) NOT NULL,\n visibility character varying(64),\n score character varying(128),\n thumbnail character varying(256) NOT NULL,\n image_url character varying(128),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n type varchar,\n operating_hours character varying(64),\n accessibility character varying(64),\n location_lat character varying(64)\n)\n\nCREATE TABLE marketing.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n website text NOT NULL,\n account_status varchar,\n api_key character varying(256) NOT NULL,\n facilitie_id integer -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n stock_level varchar,\n currency char NOT NULL,\n available char,\n thumbnail_url character varying(256),\n msrp text,\n featured_rank character varying(256) NOT NULL,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students;", "sql": null}, {"role": "user", "content": "Show me students with api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students WHERE api_key LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n created_at date,\n message character varying(128),\n shares character varying(256) NOT NULL,\n visibility character varying(64),\n score character varying(128),\n thumbnail character varying(256) NOT NULL,\n image_url character varying(128),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n type varchar,\n operating_hours character varying(64),\n accessibility character varying(64),\n location_lat character varying(64)\n)\n\nCREATE TABLE marketing.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n website text NOT NULL,\n account_status varchar,\n api_key character varying(256) NOT NULL,\n facilitie_id integer -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n stock_level varchar,\n currency char NOT NULL,\n available char,\n thumbnail_url character varying(256),\n msrp text,\n featured_rank character varying(256) NOT NULL,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with facilitie_id > 62.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.reviews WHERE facilitie_id > 62;", "sql": null}, {"role": "user", "content": "Sort the results by shares ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.reviews WHERE facilitie_id > 62 ORDER BY shares ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.reviews (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n created_at date,\n message character varying(128),\n shares character varying(256) NOT NULL,\n visibility character varying(64),\n score character varying(128),\n thumbnail character varying(256) NOT NULL,\n image_url character varying(128),\n facilitie_id integer NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.facilities (\n address_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n type varchar,\n operating_hours character varying(64),\n accessibility character varying(64),\n location_lat character varying(64)\n)\n\nCREATE TABLE marketing.students (\n customer_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n website text NOT NULL,\n account_status varchar,\n api_key character varying(256) NOT NULL,\n facilitie_id integer -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE marketing.catalog (\n item_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n stock_level varchar,\n currency char NOT NULL,\n available char,\n thumbnail_url character varying(256),\n msrp text,\n featured_rank character varying(256) NOT NULL,\n review_id text -- reference to reviews.comment_id,\n FOREIGN KEY (review_id) REFERENCES reviews(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students;", "sql": null}, {"role": "user", "content": "Arrange the results with api_key in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY api_key ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by website ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.students ORDER BY website ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Display all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Order the output by profile_picture_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members ORDER BY profile_picture_url DESC;", "sql": null}, {"role": "user", "content": "Group members by avatar and show the min of status.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, MIN(status) AS min_status FROM manufacturing.members GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "List conten_id, avatar, status from members.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, avatar, status FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Retrieve avatar, state, reply_to_id, edited_at showing the relationship between members and content.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, avatar, status, content.reply_to_id, content.edited_at FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "How many members are there per state?", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM manufacturing.members GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Display all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "What conten_id, is_active, updated_at, likes do we have for members and their associated content?", "sql": null}, {"role": "assistant", "content": "SELECT *, content.updated_at, content.likes FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "Tally up members by is_active.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(*) AS count FROM manufacturing.members GROUP BY is_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Retrieve avatar, profile_picture_url, updated_at for every member.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, profile_picture_url, updated_at FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Sort the results by conten_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, profile_picture_url, updated_at FROM manufacturing.members ORDER BY conten_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, profile_picture_url, updated_at FROM manufacturing.members ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Show me all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "List profile_picture_url, state, updated_at, edited_at for each member along with their content information.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.updated_at, content.edited_at FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.updated_at, content.edited_at FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Get all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Get status, is_active, reply_to_id, updated_at by joining members with content.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.reply_to_id, content.updated_at FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.reply_to_id, content.updated_at FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Display all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Show the results sorted by avatar descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members ORDER BY avatar DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of members across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM manufacturing.members GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "What are the status, avatar, profile_picture_url of each member?", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, profile_picture_url FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, profile_picture_url FROM manufacturing.members ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, profile_picture_url FROM manufacturing.members ORDER BY updated_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Show me all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Retrieve avatar, conten_id, updated_at, likes showing the relationship between members and content.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.updated_at, content.likes FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.updated_at, content.likes FROM manufacturing.members JOIN manufacturing.content ON members.conten_id = content.content_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.members (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n is_active bit -- indicates if active is true,\n status character varying(64),\n profile_picture_url character varying(256),\n state character varying(128) NOT NULL,\n avatar character varying(128) NOT NULL,\n conten_id text NOT NULL -- reference to content.content_id,\n FOREIGN KEY (conten_id) REFERENCES content(content_id)\n)\n\nCREATE TABLE manufacturing.content (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n reply_to_id text,\n likes text\n)\n\nCREATE TABLE manufacturing.facilities (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n city varchar NOT NULL,\n timezone character varying(128) NOT NULL,\n postal_code char,\n zip_code char,\n category char NOT NULL,\n longitude char,\n location_lon varchar\n)", "conversations": [{"role": "user", "content": "Show me status, avatar, state for all members.", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, state FROM manufacturing.members;", "sql": null}, {"role": "user", "content": "Show me members that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, state FROM manufacturing.members WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by profile_picture_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, avatar, state FROM manufacturing.members WHERE updated_at > '2023-12-01' ORDER BY profile_picture_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me currency, processed_at, audit_id for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, audit_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, audit_id FROM finance.payments WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of total grouped by payment_status for payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(total) AS count_total FROM finance.payments GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the currency, payment_status, completed_at of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT currency, payment_status, completed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match total > 95.", "sql": null}, {"role": "assistant", "content": "SELECT currency, payment_status, completed_at FROM finance.payments WHERE total > 95;", "sql": null}, {"role": "user", "content": "How many payments are there per audit_id?", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, COUNT(*) AS count FROM finance.payments GROUP BY audit_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get processed_at, payment_status, currency from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_status, currency FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_status, currency FROM finance.payments WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of payment_status grouped by processed_at for payments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, SUM(payment_status) AS sum_payment_status FROM finance.payments GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payment_status, audit_id, rating, updated_at showing the relationship between payments and audits.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.rating, audits.updated_at FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.rating, audits.updated_at FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments where amount > 49.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE amount > 49;", "sql": null}, {"role": "user", "content": "How many payments are there per currency?", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM finance.payments GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the approval_status, audit_id, amount of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, audit_id, amount FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get total, currency, parent_id, edited_at by joining payments with audits.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, audit_id, amount, audits.parent_id, audits.edited_at FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "What is the min total for each audit_id in payments?", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, MIN(total) AS min_total FROM finance.payments GROUP BY audit_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me processed_at, approval_status, completed_at for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, approval_status, completed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get all payments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, approval_status, completed_at FROM finance.payments WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by audit_id.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, COUNT(*) AS count FROM finance.payments GROUP BY audit_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "What are the completed_at, audit_id, approval_status of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, audit_id, approval_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payment_status, total, edited_at, rating showing the relationship between payments and audits.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, audit_id, approval_status, audits.edited_at, audits.rating FROM finance.payments JOIN finance.audits ON payments.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "How many payments are there per total?", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM finance.payments GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n processed_at timestamp,\n approval_status character varying(64),\n payment_status character varying(256),\n amount integer,\n total numeric(38,14),\n currency varchar,\n audit_id integer -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n credit character varying(64),\n exchange_rate character varying(256),\n verification_status char\n)\n\nCREATE TABLE finance.audits (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n updated_at date,\n image_url character varying(128),\n parent_id character varying(256) NOT NULL -- identifier for parent,\n keywords varchar,\n rating character varying(64),\n user_id character varying(256) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average payment_status for each amount in payments?", "sql": null}, {"role": "assistant", "content": "SELECT amount, AVERAGE(payment_status) AS average_payment_status FROM finance.payments GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get country, state, card_type, delivery_status by joining prescriptions with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.card_type, doctors.delivery_status FROM healthcare.prescriptions JOIN healthcare.doctors ON prescriptions.doctor_id = doctors.payment_id;", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different timezone values.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve prescriptions where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up prescriptions by country.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where prescription_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE prescription_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by delivery_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE prescription_id LIKE 'A%' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Show me city, accessibility, doctor_id for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT city, accessibility, doctor_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List prescriptions that have city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT city, accessibility, doctor_id FROM healthcare.prescriptions WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different doctor_id values.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Show me accessibility, state, doctor_id for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, state, doctor_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by state ascending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, state, doctor_id FROM healthcare.prescriptions ORDER BY state ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different doctor_id values.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by card_type descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE customer_id LIKE 'A%' ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve city, doctor_id, state for every prescription.", "sql": null}, {"role": "assistant", "content": "SELECT city, doctor_id, state FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve name, city, customer_id, prescription_id showing the relationship between prescriptions and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT city, doctor_id, state, doctors.customer_id, doctors.prescription_id FROM healthcare.prescriptions JOIN healthcare.doctors ON prescriptions.doctor_id = doctors.payment_id;", "sql": null}, {"role": "user", "content": "Group prescriptions by doctor_id and show the min of accessibility.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, MIN(accessibility) AS min_accessibility FROM healthcare.prescriptions GROUP BY doctor_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, created_at, card_type of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, card_type FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Order the output by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, card_type FROM healthcare.doctors ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, card_type FROM healthcare.doctors ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List name, state, customer_id, card_type for each prescription along with their doctor information.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.customer_id, doctors.card_type FROM healthcare.prescriptions JOIN healthcare.doctors ON prescriptions.doctor_id = doctors.payment_id;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.customer_id, doctors.card_type FROM healthcare.prescriptions JOIN healthcare.doctors ON prescriptions.doctor_id = doctors.payment_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n store_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n country varchar,\n timezone varchar,\n state character varying(128) NOT NULL,\n city character varying(256),\n name character varying(64) NOT NULL,\n accessibility varchar,\n doctor_id integer NOT NULL -- reference to doctors.payment_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(payment_id)\n)\n\nCREATE TABLE healthcare.doctors (\n payment_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n approval_status char,\n buyer_id char NOT NULL -- identifier for buyer,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n delivery_status character varying(128),\n card_type text,\n prescription_id text -- reference to prescriptions.store_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(store_id)\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me prescription_id, delivery_status, city, last_inspected from doctors and their related prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.city, prescriptions.last_inspected FROM healthcare.doctors JOIN healthcare.prescriptions ON doctors.prescription_id = prescriptions.store_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.city, prescriptions.last_inspected FROM healthcare.doctors JOIN healthcare.prescriptions ON doctors.prescription_id = prescriptions.store_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n shares character varying(128),\n views varchar,\n description text NOT NULL,\n message char,\n subject character varying(128) NOT NULL,\n grade_id text -- reference to grades.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(transaction_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n user_id character varying(128),\n category character varying(128),\n notes character varying(128),\n status character varying(256),\n balance decimal,\n customer_id character varying(128) -- identifier for customer\n)\n\nCREATE TABLE education.enrollments (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n vendor_id char -- identifier for vendor,\n approval_status varchar NOT NULL,\n verification_status character varying(128),\n payee_id character varying(128) -- identifier for payee,\n reconciliation_status char\n)\n\nCREATE TABLE education.courses (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n media_url text,\n popularity_score character varying(256),\n image_url character varying(64),\n cost numeric,\n currency character varying(64) NOT NULL,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY created_at DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n shares character varying(128),\n views varchar,\n description text NOT NULL,\n message char,\n subject character varying(128) NOT NULL,\n grade_id text -- reference to grades.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(transaction_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n user_id character varying(128),\n category character varying(128),\n notes character varying(128),\n status character varying(256),\n balance decimal,\n customer_id character varying(128) -- identifier for customer\n)\n\nCREATE TABLE education.enrollments (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n vendor_id char -- identifier for vendor,\n approval_status varchar NOT NULL,\n verification_status character varying(128),\n payee_id character varying(128) -- identifier for payee,\n reconciliation_status char\n)\n\nCREATE TABLE education.courses (\n barcode text PRIMARY KEY -- unique identifier,\n updated_at date,\n media_url text,\n popularity_score character varying(256),\n image_url character varying(64),\n cost numeric,\n currency character varying(64) NOT NULL,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min views for each created_at in departments?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(views) AS min_views FROM education.departments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with currency in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY currency ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "List description, geo_point, capacity from investments.", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, capacity FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get all investments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, capacity FROM finance.investments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by description descending?", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, capacity FROM finance.investments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "List all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE description LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY updated_at ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me currency, card_type, payment_status for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, payment_status FROM finance.payments;", "sql": null}, {"role": "user", "content": "List currency, traded_at, description, updated_at for each payment along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, payment_status, investments.description, investments.updated_at FROM finance.payments JOIN finance.investments ON payments.investment_id = investments.venue_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by traded_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, card_type, payment_status, investments.description, investments.updated_at FROM finance.payments JOIN finance.investments ON payments.investment_id = investments.venue_id ORDER BY traded_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, payment_id, geo_point from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_id, geo_point FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_id, geo_point FROM finance.investments WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of investments across different parking_available values.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM finance.investments GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "List payment_id, created_at, approval_status, investment_id for each investment along with their payment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.approval_status, payments.investment_id FROM finance.investments JOIN finance.payments ON investments.payment_id = payments.invoice_id;", "sql": null}, {"role": "user", "content": "How many investments are there per payment_id?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM finance.investments GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the capacity, geo_point, parking_available of each investment?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, geo_point, parking_available FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show me created_at, parking_available, investment_id, currency from investments and their related payments.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, geo_point, parking_available, payments.investment_id, payments.currency FROM finance.investments JOIN finance.payments ON investments.payment_id = payments.invoice_id;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, geo_point, parking_available, payments.investment_id, payments.currency FROM finance.investments JOIN finance.payments ON investments.payment_id = payments.invoice_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY parking_available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n description text,\n capacity text,\n parking_available varchar,\n geo_point character varying(256),\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n currency character varying(256),\n payment_status text NOT NULL,\n approval_status varchar,\n card_type character varying(256),\n investment_id integer NOT NULL -- reference to investments.venue_id,\n FOREIGN KEY (investment_id) REFERENCES investments(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve parking_available, updated_at, created_at for every investment.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, updated_at, created_at FROM finance.investments;", "sql": null}, {"role": "user", "content": "Sort the results by geo_point ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, updated_at, created_at FROM finance.investments ORDER BY geo_point ASC;", "sql": null}, {"role": "user", "content": "Show me average of capacity grouped by payment_id for investments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, AVERAGE(capacity) AS average_capacity FROM finance.investments GROUP BY payment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "List investments with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by language.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(*) AS count FROM finance.investments GROUP BY language ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List gender, investment_id, website, language for each customer along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.website, investments.language FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.person_id;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.website, investments.language FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.person_id ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Get bio, is_active, display_name from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT bio, is_active, display_name FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT bio, is_active, display_name FROM finance.investments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate sum of is_active for each is_active in investments.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, SUM(is_active) AS sum_is_active FROM finance.investments GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "List gender, full_name, investment_id from customers.", "sql": null}, {"role": "assistant", "content": "SELECT gender, full_name, investment_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by gender descending?", "sql": null}, {"role": "assistant", "content": "SELECT gender, full_name, investment_id FROM finance.customers ORDER BY gender DESC;", "sql": null}, {"role": "user", "content": "Tally up customers by last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM finance.customers GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get investments that match is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE is_active = TRUE LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, website, language for all investments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, website, language FROM finance.investments;", "sql": null}, {"role": "user", "content": "List bio, is_active, updated_at, investment_id for each investment along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, website, language, customers.updated_at, customers.investment_id FROM finance.investments JOIN finance.customers ON investments.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, website, language, customers.updated_at, customers.investment_id FROM finance.investments JOIN finance.customers ON investments.customer_id = customers.user_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "List is_active, language, customer_id from investments.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, language, customer_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by display_name descending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, language, customer_id FROM finance.investments ORDER BY display_name DESC;", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by display_name.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM finance.investments GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "List timezone, is_active, investment_id, gender for each investment along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.investment_id, customers.gender FROM finance.investments JOIN finance.customers ON investments.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.investments GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n gender character varying(256) NOT NULL,\n full_name char NOT NULL,\n bio varchar,\n investment_id text -- reference to investments.person_id,\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n language character varying(128),\n display_name text,\n bio varchar NOT NULL,\n website character varying(64) NOT NULL,\n timezone character varying(256) NOT NULL,\n is_active boolean -- indicates if active is true,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve full_name, bio, investment_id for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, bio, investment_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, bio, investment_id FROM finance.customers WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, bio, investment_id FROM finance.customers WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "List all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get investments that match msrp LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE msrp LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up investments by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM finance.investments GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Get product_id, expires_at, price from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, expires_at, price FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, expires_at, price FROM finance.investments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group investments by expires_at and show the min of price.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MIN(price) AS min_price FROM finance.investments GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get all investments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of investments grouped by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM finance.investments GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Display all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "What is the max expires_at for each product_id in investments?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, MAX(expires_at) AS max_expires_at FROM finance.investments GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate max of customer_id for each name in investments.", "sql": null}, {"role": "assistant", "content": "SELECT name, MAX(customer_id) AS max_customer_id FROM finance.investments GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "What are the price, product_id, name of each investment?", "sql": null}, {"role": "assistant", "content": "SELECT price, product_id, name FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT price, product_id, name FROM finance.investments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of investments across different customer_id values.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM finance.investments GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Get customer_id, created_at, price from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, price FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, price FROM finance.investments ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, created_at, price FROM finance.investments ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Get msrp, expires_at, price from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, expires_at, price FROM finance.investments;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, expires_at, price FROM finance.investments ORDER BY expires_at DESC;", "sql": null}, {"role": "user", "content": "Get min of customer_id by customer_id from investments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MIN(customer_id) AS min_customer_id FROM finance.investments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n traded_at timestamp without time zone,\n discount integer NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE finance.investments (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp without time zone,\n msrp char NOT NULL,\n name character varying(256),\n price numeric(38,14),\n customer_id integer -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n full_name text,\n zip_code char,\n membership_level character varying(128),\n account_status character varying(64),\n is_active bit NOT NULL -- indicates if active is true\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where customer_id > 76.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE customer_id > 76;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE customer_id > 76 ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Find catalog older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve reserved, media_url, conten_id for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, media_url, conten_id FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Can you order these by conten_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, media_url, conten_id FROM manufacturing.catalog ORDER BY conten_id ASC;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, media_url, conten_id FROM manufacturing.catalog ORDER BY conten_id ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "List catalog with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up catalog by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM manufacturing.catalog GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Find catalog where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE media_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Retrieve currency, media_url, image_url, created_at showing the relationship between catalog and content.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.image_url, content.created_at FROM manufacturing.catalog JOIN manufacturing.content ON catalog.conten_id = content.id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.image_url, content.created_at FROM manufacturing.catalog JOIN manufacturing.content ON catalog.conten_id = content.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve conten_id, sku, published_at for every catalog.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, sku, published_at FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Arrange the results with msrp in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, sku, published_at FROM manufacturing.catalog ORDER BY msrp DESC;", "sql": null}, {"role": "user", "content": "Show me max of currency grouped by subcategory for catalog.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, MAX(currency) AS max_currency FROM manufacturing.catalog GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Show the results sorted by msrp ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog ORDER BY msrp ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog ORDER BY media_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all catalog.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Retrieve catalog where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM manufacturing.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of catalog grouped by reserved.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM manufacturing.catalog GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE manufacturing.addresses (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n last_inspected date,\n latitude character varying(256),\n location_lon text NOT NULL,\n street char,\n location_lat character varying(256) NOT NULL,\n coordinates character varying(128),\n timezone character varying(128),\n zip_code character varying(256)\n)\n\nCREATE TABLE manufacturing.content (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n media_url text NOT NULL,\n keywords text NOT NULL,\n image_url character varying(128),\n description text\n)\n\nCREATE TABLE manufacturing.catalog (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n subcategory character varying(256) NOT NULL,\n currency char NOT NULL,\n reserved character varying(256),\n media_url character varying(128),\n msrp varchar,\n conten_id text NOT NULL -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)\n\nCREATE TABLE manufacturing.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n customer_id character varying(64) -- identifier for customer,\n user_id character varying(256),\n description character varying(128),\n invoice_number character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List conten_id, reserved, msrp from catalog.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, reserved, msrp FROM manufacturing.catalog;", "sql": null}, {"role": "user", "content": "Show me catalog that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, reserved, msrp FROM manufacturing.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by reserved ascending.", "sql": null}, {"role": "assistant", "content": "SELECT conten_id, reserved, msrp FROM manufacturing.catalog WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY reserved ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n payment_status character varying(128) NOT NULL,\n customer_id char -- identifier for customer,\n approval_status char,\n tax numeric(38,14),\n enrollment_id integer NOT NULL -- reference to enrollments.employee_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(employee_id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active date,\n gender char,\n membership_level character varying(128),\n api_key character varying(256),\n language character varying(64),\n is_verified boolean,\n password_hash character varying(256) NOT NULL,\n nationality character varying(256)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n score char,\n attachment_url text NOT NULL,\n description char NOT NULL,\n thumbnail text,\n visibility varchar NOT NULL,\n content varchar NOT NULL,\n student_id integer -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n password_hash varchar,\n membership_level character varying(64) NOT NULL,\n username text NOT NULL,\n department_id text NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments where department_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE department_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by username descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE department_id LIKE 'A%' ORDER BY username DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n payment_status character varying(128) NOT NULL,\n customer_id char -- identifier for customer,\n approval_status char,\n tax numeric(38,14),\n enrollment_id integer NOT NULL -- reference to enrollments.employee_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(employee_id)\n)\n\nCREATE TABLE education.students (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n last_active date,\n gender char,\n membership_level character varying(128),\n api_key character varying(256),\n language character varying(64),\n is_verified boolean,\n password_hash character varying(256) NOT NULL,\n nationality character varying(256)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n score char,\n attachment_url text NOT NULL,\n description char NOT NULL,\n thumbnail text,\n visibility varchar NOT NULL,\n content varchar NOT NULL,\n student_id integer -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.enrollments (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n password_hash varchar,\n membership_level character varying(64) NOT NULL,\n username text NOT NULL,\n department_id text NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY created_at ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "List last_inspected, type, name from departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, type, name FROM education.departments;", "sql": null}, {"role": "user", "content": "Can you order these by address_line2 descending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, type, name FROM education.departments ORDER BY address_line2 DESC;", "sql": null}, {"role": "user", "content": "What is the sum updated_at for each name in departments?", "sql": null}, {"role": "assistant", "content": "SELECT name, SUM(updated_at) AS sum_updated_at FROM education.departments GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of departments in each last_inspected category.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM education.departments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Get departments that match parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE parking_available LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "List departments that have teacher_id > 48.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE teacher_id > 48;", "sql": null}, {"role": "user", "content": "Order the output by name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE teacher_id > 48 ORDER BY name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Sort the results by teacher_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY teacher_id DESC;", "sql": null}, {"role": "user", "content": "Calculate sum of name for each last_inspected in departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, SUM(name) AS sum_name FROM education.departments GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group departments by name and show the sum of category.", "sql": null}, {"role": "assistant", "content": "SELECT name, SUM(category) AS sum_category FROM education.departments GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up departments by capacity.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM education.departments GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE address_line2 LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n processed_at timestamp without time zone,\n exchange_rate char,\n status character varying(128) NOT NULL,\n user_id text -- identifier for user,\n amount integer,\n total decimal NOT NULL,\n subtotal numeric\n)\n\nCREATE TABLE education.departments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp,\n updated_at timestamp without time zone,\n capacity varchar NOT NULL,\n address_line2 character varying(128),\n type char,\n category character varying(64) NOT NULL,\n name character varying(64) NOT NULL,\n parking_available character varying(128),\n teacher_id integer -- reference to teachers.user_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(user_id)\n)\n\nCREATE TABLE education.teachers (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n api_key character varying(64),\n avatar character varying(128),\n birth_date timestamp without time zone NOT NULL,\n is_verified bit -- indicates if verified is true,\n membership_level character varying(256) NOT NULL,\n token text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me teacher_id, venue_id, type for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, venue_id, type FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, venue_id, type FROM education.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up departments by name.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM education.departments GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, discount, payment_method for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, discount, payment_method FROM sports.sales;", "sql": null}, {"role": "user", "content": "Show me discount, status, cost, published_at from sales and their related merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, discount, payment_method, merchandise.cost, merchandise.published_at FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, discount, payment_method, merchandise.cost, merchandise.published_at FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve merchandis_id, completed_at, payment_method for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, completed_at, payment_method FROM sports.sales;", "sql": null}, {"role": "user", "content": "Show me merchandis_id, status, published_at, cost from sales and their related merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT merchandis_id, completed_at, payment_method, merchandise.published_at, merchandise.cost FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Get min of status by approval_status from sales.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MIN(status) AS min_status FROM sports.sales GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.sales;", "sql": null}, {"role": "user", "content": "Get status, approval_status, published_at, cost by joining sales with merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.published_at, merchandise.cost FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, merchandise.published_at, merchandise.cost FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.sales;", "sql": null}, {"role": "user", "content": "Retrieve sales where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.sales WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.sales WHERE status LIKE 'A%' ORDER BY payment_method ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve payment_method, completed_at, discount for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, discount FROM sports.sales;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, discount FROM sports.sales ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, discount FROM sports.sales ORDER BY completed_at ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get completed_at, payment_status, merchandis_id from all sales.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, merchandis_id FROM sports.sales;", "sql": null}, {"role": "user", "content": "List payment_status, status, cost, published_at for each sale along with their merchandise information.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, merchandis_id, merchandise.cost, merchandise.published_at FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, merchandis_id, merchandise.cost, merchandise.published_at FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List payment_method, merchandis_id, completed_at from sales.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, merchandis_id, completed_at FROM sports.sales;", "sql": null}, {"role": "user", "content": "Get status, payment_status, published_at, cost by joining sales with merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, merchandis_id, completed_at, merchandise.published_at, merchandise.cost FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Count the number of sales in each payment_method category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM sports.sales GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me payment_status, completed_at, merchandis_id for all sales.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, merchandis_id FROM sports.sales;", "sql": null}, {"role": "user", "content": "Show me status, approval_status, cost, published_at from sales and their related merchandise.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, merchandis_id, merchandise.cost, merchandise.published_at FROM sports.sales JOIN sports.merchandise ON sales.merchandis_id = merchandise.id;", "sql": null}, {"role": "user", "content": "Show me the count of sales grouped by completed_at.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(*) AS count FROM sports.sales GROUP BY completed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get payment_method, completed_at, approval_status from all sales.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, approval_status FROM sports.sales;", "sql": null}, {"role": "user", "content": "Show the results sorted by completed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, approval_status FROM sports.sales ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, completed_at, approval_status FROM sports.sales ORDER BY completed_at DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.sales (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n approval_status text NOT NULL,\n status varchar,\n payment_method character varying(128) NOT NULL,\n payment_status varchar,\n discount integer,\n merchandis_id text NOT NULL -- reference to merchandise.id,\n FOREIGN KEY (merchandis_id) REFERENCES merchandise(id)\n)\n\nCREATE TABLE sports.merchandise (\n id text PRIMARY KEY -- unique identifier,\n published_at date,\n views char,\n rating character varying(128),\n cost smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me status, payment_method, completed_at for all sales.", "sql": null}, {"role": "assistant", "content": "SELECT status, payment_method, completed_at FROM sports.sales;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT status, payment_method, completed_at FROM sports.sales ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Tally up sales by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM sports.sales GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get comment_id, published_at, subject from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, published_at, subject FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, published_at, subject FROM socialmedia.messages WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with author_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, published_at, subject FROM socialmedia.messages WHERE published_at > '2023-01-01' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Show me likes, title, edited_at for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT likes, title, edited_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT likes, title, edited_at FROM socialmedia.messages WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me average of title grouped by likes for messages.", "sql": null}, {"role": "assistant", "content": "SELECT likes, AVERAGE(title) AS average_title FROM socialmedia.messages GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve title, author_id, thumbnail for every message.", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, thumbnail FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get messages that match edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, thumbnail FROM socialmedia.messages WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, thumbnail FROM socialmedia.messages WHERE edited_at > '2023-01-01' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get comment_id, thumbnail, likes from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, thumbnail, likes FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, thumbnail, likes FROM socialmedia.messages WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, thumbnail, likes FROM socialmedia.messages WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by comment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY comment_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY title ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get edited_at, title, subject from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, title, subject FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, title, subject FROM socialmedia.messages WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate sum of published_at for each thumbnail in messages.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, SUM(published_at) AS sum_published_at FROM socialmedia.messages GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n edited_at date,\n title char,\n author_id character varying(128) NOT NULL -- identifier for author,\n thumbnail char NOT NULL,\n likes char,\n subject character varying(64),\n media_url text\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(64),\n description character varying(256),\n subject character varying(256),\n content text,\n media_url char,\n views character varying(256) NOT NULL,\n author_id varchar -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up messages by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM socialmedia.messages GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "List reconciliation_status, category, created_at from grades.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, category, created_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me reconciliation_status, payment_date, attachment_url, published_at from grades and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, category, created_at, departments.attachment_url, departments.published_at FROM education.grades JOIN education.departments ON grades.department_id = departments.comment_id;", "sql": null}, {"role": "user", "content": "Count the number of grades in each category category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM education.grades GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve department_id, created_at, payment_date for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, created_at, payment_date FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve created_at, payment_date, grade_id, attachment_url showing the relationship between grades and departments.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, created_at, payment_date, departments.grade_id, departments.attachment_url FROM education.grades JOIN education.departments ON grades.department_id = departments.comment_id;", "sql": null}, {"role": "user", "content": "Get min of department_id by department_id from grades.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MIN(department_id) AS min_department_id FROM education.grades GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE payment_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE payment_date = CURRENT_DATE - INTERVAL '1 day' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM education.departments GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "What are the grade_id, published_at, attachment_url of each department?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, published_at, attachment_url FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve published_at, grade_id, reference_number, category showing the relationship between departments and grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, published_at, attachment_url, grades.reference_number, grades.category FROM education.departments JOIN education.grades ON departments.grade_id = grades.account_id;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different grade_id values.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.departments GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Get category, payment_date, department_id from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT category, payment_date, department_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve department_id, payment_date, description, author_id showing the relationship between grades and departments.", "sql": null}, {"role": "assistant", "content": "SELECT category, payment_date, department_id, departments.description, departments.author_id FROM education.grades JOIN education.departments ON grades.department_id = departments.comment_id;", "sql": null}, {"role": "user", "content": "Tally up grades by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM education.grades GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "What are the reconciliation_status, payment_date, created_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, payment_date, created_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, payment_date, created_at FROM education.grades WHERE payment_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.grades GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades that have reconciliation_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE reconciliation_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE reconciliation_status LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "List reply_to_id, author_id, published_at from departments.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, author_id, published_at FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, author_id, published_at FROM education.departments WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, author_id, published_at FROM education.departments WHERE attachment_url LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n reply_to_id varchar NOT NULL,\n description character varying(128) NOT NULL,\n author_id character varying(256),\n attachment_url character varying(64),\n grade_id text -- reference to grades.account_id,\n FOREIGN KEY (grade_id) REFERENCES grades(account_id)\n)\n\nCREATE TABLE education.grades (\n account_id text PRIMARY KEY -- unique identifier,\n payment_date date,\n created_at timestamp without time zone,\n reconciliation_status character varying(128),\n category character varying(256),\n reference_number varchar,\n department_id text -- reference to departments.comment_id,\n FOREIGN KEY (department_id) REFERENCES departments(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me description, attachment_url, grade_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, grade_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me description, reply_to_id, reconciliation_status, category from departments and their related grades.", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, grade_id, grades.reconciliation_status, grades.category FROM education.departments JOIN education.grades ON departments.grade_id = grades.account_id;", "sql": null}, {"role": "user", "content": "Sort the results by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, grade_id, grades.reconciliation_status, grades.category FROM education.departments JOIN education.grades ON departments.grade_id = grades.account_id ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different rating values.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM e-commerce.inventory GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve subcategory, rating, available for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, rating, available FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by msrp descending.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, rating, available FROM e-commerce.inventory ORDER BY msrp DESC;", "sql": null}, {"role": "user", "content": "Show me min of subcategory grouped by image_url for inventory.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MIN(subcategory) AS min_subcategory FROM e-commerce.inventory GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List orders that have price > 18.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE price > 18;", "sql": null}, {"role": "user", "content": "Calculate average of completed_at for each completed_at in orders.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, AVERAGE(completed_at) AS average_completed_at FROM e-commerce.orders GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List order_id, published_at, price, exchange_rate for each inventory along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.price, orders.exchange_rate FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Arrange the results with available in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.price, orders.exchange_rate FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.payment_id ORDER BY available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve inventory where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get sum of msrp by available from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT available, SUM(msrp) AS sum_msrp FROM e-commerce.inventory GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Get subcategory, available, published_at from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, available, published_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve image_url, available, price, status showing the relationship between inventory and orders.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, available, published_at, orders.price, orders.status FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Can you order these by order_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, available, published_at, orders.price, orders.status FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.payment_id ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Get orders that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE status LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "List user_id, completed_at, price from orders.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, completed_at, price FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me user_id, status, rating, published_at from orders and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, completed_at, price, inventory.rating, inventory.published_at FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.product_id;", "sql": null}, {"role": "user", "content": "Count the number of orders in each completed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(*) AS count FROM e-commerce.orders GROUP BY completed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Show me available, image_url, msrp for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT available, image_url, msrp FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve order_id, published_at, completed_at, price showing the relationship between inventory and orders.", "sql": null}, {"role": "assistant", "content": "SELECT available, image_url, msrp, orders.completed_at, orders.price FROM e-commerce.inventory JOIN e-commerce.orders ON inventory.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Group inventory by order_id and show the count of subcategory.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(subcategory) AS count_subcategory FROM e-commerce.inventory GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n product_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n image_url char,\n available varchar NOT NULL,\n rating character varying(256),\n msrp char,\n subcategory character varying(64),\n order_id integer NOT NULL -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n exchange_rate char NOT NULL,\n price bigint NOT NULL,\n user_id character varying(64),\n status character varying(256) NOT NULL,\n inventor_id text -- reference to inventory.product_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE user_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List status, gender, user_id, format for each doctor along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.user_id, departments.format FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of doctors across different last_active values.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM healthcare.doctors GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by gender descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE gender LIKE 'A%' ORDER BY gender DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of doctors grouped by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.doctors GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me joined_at, full_name, format, published_at from doctors and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.format, departments.published_at FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Get the distribution of doctors across different password_hash values.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM healthcare.doctors GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the password_hash, gender, full_name of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, gender, full_name FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, gender, full_name FROM healthcare.doctors WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "What is the average gender for each password_hash in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, AVERAGE(gender) AS average_gender FROM healthcare.doctors GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the max city for each department_id in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MAX(city) AS max_city FROM healthcare.doctors GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, last_active, city for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, last_active, city FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, last_active, city FROM healthcare.doctors WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, last_active, city FROM healthcare.doctors WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "What password_hash, employee_id, published_at, format do we have for doctors and their associated departments?", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.published_at, departments.format FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.published_at, departments.format FROM healthcare.doctors JOIN healthcare.departments ON doctors.department_id = departments.message_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Tally up doctors by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM healthcare.doctors GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n last_active date,\n full_name char,\n password_hash character varying(128) NOT NULL,\n city character varying(256),\n status char,\n gender text,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp,\n views char,\n discount bigint,\n image_url varchar NOT NULL,\n brand char\n)\n\nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n user_id char NOT NULL,\n format character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Order the output by employee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY employee_id ASC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY employee_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Show me tags, published_at, follower_id for all posts.", "sql": null}, {"role": "assistant", "content": "SELECT tags, published_at, follower_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by shares ascending.", "sql": null}, {"role": "assistant", "content": "SELECT tags, published_at, follower_id FROM socialmedia.posts ORDER BY shares ASC;", "sql": null}, {"role": "user", "content": "Group posts by published_at and show the count of tags.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(tags) AS count_tags FROM socialmedia.posts GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve follower_id, views, tags for every post.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, views, tags FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match tags LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, views, tags FROM socialmedia.posts WHERE tags LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, views, tags FROM socialmedia.posts WHERE tags LIKE 'A%' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve published_at, views, last_login, is_active showing the relationship between posts and followers.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.last_login, followers.is_active FROM socialmedia.posts JOIN socialmedia.followers ON posts.follower_id = followers.user_id;", "sql": null}, {"role": "user", "content": "How many posts are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.posts GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "List post_id, seller_id, discount from events.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, seller_id, discount FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, seller_id, discount FROM socialmedia.events WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up events by payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM socialmedia.events GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by follower_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY follower_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different views values.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM socialmedia.posts GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve discount, seller_id, invoice_id for every event.", "sql": null}, {"role": "assistant", "content": "SELECT discount, seller_id, invoice_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT discount, seller_id, invoice_id FROM socialmedia.events WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT discount, seller_id, invoice_id FROM socialmedia.events WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY subtotal DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group events by discount and show the min of completed_at.", "sql": null}, {"role": "assistant", "content": "SELECT discount, MIN(completed_at) AS min_completed_at FROM socialmedia.events GROUP BY discount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different tags values.", "sql": null}, {"role": "assistant", "content": "SELECT tags, COUNT(*) AS count FROM socialmedia.posts GROUP BY tags ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_id, payment_method, traded_at for every event.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, payment_method, traded_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Order the output by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, payment_method, traded_at FROM socialmedia.events ORDER BY post_id ASC;", "sql": null}, {"role": "user", "content": "Get min of seller_id by post_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, MIN(seller_id) AS min_seller_id FROM socialmedia.events GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n tags text,\n visibility char,\n views character varying(64),\n shares char,\n follower_id text -- reference to followers.user_id,\n FOREIGN KEY (follower_id) REFERENCES followers(user_id)\n)\n\nCREATE TABLE socialmedia.followers (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp NOT NULL,\n status text NOT NULL,\n first_name character varying(128),\n nationality character varying(128),\n is_active boolean -- indicates if active is true\n)\n\nCREATE TABLE socialmedia.events (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n seller_id character varying(64),\n subtotal integer NOT NULL,\n discount decimal NOT NULL,\n payment_method character varying(64),\n post_id integer -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)", "conversations": [{"role": "user", "content": "List views, updated_at, published_at from posts.", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, published_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, published_at FROM socialmedia.posts ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT views, updated_at, published_at FROM socialmedia.posts ORDER BY updated_at ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List trade_id, customer_id, category from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, customer_id, category FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, customer_id, category FROM tradingplatform.metadata WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up metadata by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of metadata in each trade_id category.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY trade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me payment_date, category, updated_at for all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, category, updated_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have trade_id > 64.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, category, updated_at FROM tradingplatform.metadata WHERE trade_id > 64;", "sql": null}, {"role": "user", "content": "Get min of exchange_rate by payment_date from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT payment_date, MIN(exchange_rate) AS min_exchange_rate FROM tradingplatform.metadata GROUP BY payment_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the invoice_id, payment_date, updated_at of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, payment_date, updated_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, payment_date, updated_at FROM tradingplatform.metadata WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, payment_date, updated_at FROM tradingplatform.metadata WHERE updated_at > '2023-01-01' ORDER BY payment_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get all metadata from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of metadata across different trade_id values.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY trade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List updated_at, trade_id, cancelled_at, total for each metadata along with their trade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.cancelled_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id;", "sql": null}, {"role": "user", "content": "Order the output by trade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.cancelled_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id ORDER BY trade_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get payment_date, updated_at, amount, total by joining metadata with trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.amount, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id;", "sql": null}, {"role": "user", "content": "Get min of category by updated_at from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(category) AS min_category FROM tradingplatform.metadata GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the updated_at, invoice_id, payment_date of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, payment_date FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me trade_id, updated_at, updated_at, total from metadata and their related trades.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, payment_date, trades.updated_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, payment_date, trades.updated_at, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List trade_id, payment_date, updated_at, currency for each metadata along with their trade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.updated_at, trades.currency FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.updated_at, trades.currency FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n category character varying(64) NOT NULL,\n exchange_rate character varying(128),\n customer_id character varying(128) NOT NULL,\n trade_id integer NOT NULL -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n cancelled_at timestamp,\n buyer_id char -- identifier for buyer,\n amount decimal,\n currency char,\n user_id character varying(64) -- identifier for user,\n total smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get exchange_rate, updated_at, buyer_id, total by joining metadata with trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.buyer_id, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.buyer_id, trades.total FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.order_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by shippin_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at > '2023-12-01' ORDER BY shippin_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with shippin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE shippin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by shippin_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE shippin_id LIKE 'A%' ORDER BY shippin_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, format, description for every review.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, format, description FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match shippin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, format, description FROM e-commerce.reviews WHERE shippin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, format, description FROM e-commerce.reviews WHERE shippin_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the post_id, format, shippin_id of each review?", "sql": null}, {"role": "assistant", "content": "SELECT post_id, format, shippin_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with format in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, format, shippin_id FROM e-commerce.reviews ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, format, shippin_id FROM e-commerce.reviews ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get shippin_id, format, debit, created_at by joining reviews with shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.debit, shipping.created_at FROM e-commerce.reviews JOIN e-commerce.shipping ON reviews.shippin_id = shipping.payment_id;", "sql": null}, {"role": "user", "content": "Tally up reviews by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.reviews GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by post_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY post_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by shippin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY shippin_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n description char,\n format character varying(128),\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n thumbnail_url character varying(256),\n manufacturer character varying(256),\n rating text,\n discount numeric NOT NULL,\n image_url varchar,\n shippin_id text NOT NULL -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n debit character varying(128),\n balance numeric NOT NULL,\n payee_id character varying(128) -- identifier for payee,\n category text\n)\n\nCREATE TABLE e-commerce.categories (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n expires_at timestamp,\n video_url text NOT NULL -- identifier for video_url,\n subcategory text NOT NULL,\n discount numeric,\n description text,\n cost decimal NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the thumbnail_url, updated_at, item_id of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, item_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, updated_at, item_id FROM e-commerce.order_items WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of shippin_id for each manufacturer in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(shippin_id) AS count_shippin_id FROM e-commerce.order_items GROUP BY manufacturer;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE due_date >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of groups across different currency values.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM socialmedia.groups GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "List all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "What reserved, image_url, category, user_id do we have for likes and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.category, groups.user_id FROM socialmedia.likes JOIN socialmedia.groups ON likes.group_id = groups.id;", "sql": null}, {"role": "user", "content": "Show me max of created_at grouped by tax_rate for likes.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, MAX(created_at) AS max_created_at FROM socialmedia.likes GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "What are the group_id, user_id, created_at of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, created_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "What author_id, user_id, approval_status, currency do we have for comments and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, created_at, groups.approval_status, groups.currency FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.id;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, user_id, created_at, groups.approval_status, groups.currency FROM socialmedia.comments JOIN socialmedia.groups ON comments.group_id = groups.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "Show me due_date, currency, user_id for all groups.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, currency, user_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, currency, user_id FROM socialmedia.groups WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group groups by balance and show the average of approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT balance, AVERAGE(approval_status) AS average_approval_status FROM socialmedia.groups GROUP BY balance;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, image_url, reserved for all likes.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, reserved FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Retrieve created_at, image_url, vendor_id, balance showing the relationship between likes and groups.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, reserved, groups.vendor_id, groups.balance FROM socialmedia.likes JOIN socialmedia.groups ON likes.group_id = groups.id;", "sql": null}, {"role": "user", "content": "Show me min of expires_at grouped by expires_at for likes.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MIN(expires_at) AS min_expires_at FROM socialmedia.likes GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me vendor_id, reconciliation_status, image_url, reserved from groups and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.image_url, likes.reserved FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.barcode;", "sql": null}, {"role": "user", "content": "Calculate sum of user_id for each vendor_id in groups.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, SUM(user_id) AS sum_user_id FROM socialmedia.groups GROUP BY vendor_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "What are the like_id, user_id, balance of each group?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, user_id, balance FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by due_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, user_id, balance FROM socialmedia.groups ORDER BY due_date ASC;", "sql": null}, {"role": "user", "content": "What is the max balance for each category in groups?", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(balance) AS max_balance FROM socialmedia.groups GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "What are the vendor_id, due_date, category of each group?", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, due_date, category FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Sort the results by due_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, due_date, category FROM socialmedia.groups ORDER BY due_date DESC;", "sql": null}, {"role": "user", "content": "Count the number of groups in each reconciliation_status category.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, COUNT(*) AS count FROM socialmedia.groups GROUP BY reconciliation_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "What are the currency, approval_status, reconciliation_status of each group?", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, reconciliation_status FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me reconciliation_status, currency, created_at, group_id from groups and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, reconciliation_status, likes.created_at, likes.group_id FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.barcode;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT currency, approval_status, reconciliation_status, likes.created_at, likes.group_id FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.barcode LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n reconciliation_status text,\n user_id character varying(128) -- identifier for user,\n vendor_id text,\n approval_status character varying(128),\n balance integer,\n category char NOT NULL,\n currency char,\n like_id integer NOT NULL -- reference to likes.barcode,\n FOREIGN KEY (like_id) REFERENCES likes(barcode)\n)\n\nCREATE TABLE socialmedia.likes (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n tax_rate text,\n image_url character varying(64) NOT NULL,\n reserved character varying(64),\n group_id text -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n user_id text,\n format character varying(256) NOT NULL,\n author_id character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)", "conversations": [{"role": "user", "content": "Get group_id, reserved, expires_at from all likes.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, reserved, expires_at FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, reserved, expires_at FROM socialmedia.likes ORDER BY expires_at DESC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, reserved, expires_at FROM socialmedia.likes ORDER BY expires_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Arrange the results with vendor_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions ORDER BY vendor_id ASC;", "sql": null}, {"role": "user", "content": "Get sum of credit by reconciliation_status from subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, SUM(credit) AS sum_credit FROM banking.subscriptions GROUP BY reconciliation_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Order the output by credit ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions ORDER BY credit ASC;", "sql": null}, {"role": "user", "content": "Count the number of subscriptions in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM banking.subscriptions GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Arrange the results with vendor_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions ORDER BY vendor_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions ORDER BY vendor_id ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_number, reconciliation_status, vendor_id for every subscription.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, vendor_id FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Get subscriptions that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, vendor_id FROM banking.subscriptions WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up subscriptions by invoice_id.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM banking.subscriptions GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Find subscriptions created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.subscriptions WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the max invoice_id for each user_id in subscriptions?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MAX(invoice_id) AS max_invoice_id FROM banking.subscriptions GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get created_at, vendor_id, user_id from all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, vendor_id, user_id FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "List subscriptions with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, vendor_id, user_id FROM banking.subscriptions WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, vendor_id, user_id FROM banking.subscriptions WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, invoice_id, reconciliation_status for every subscription.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, reconciliation_status FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "What created_at, invoice_id, status, token do we have for subscriptions and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, reconciliation_status, users.status, users.token FROM banking.subscriptions JOIN banking.users ON subscriptions.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, invoice_id, reconciliation_status, users.status, users.token FROM banking.subscriptions JOIN banking.users ON subscriptions.user_id = users.person_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me invoice_number, reconciliation_status, credit for all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, credit FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Find subscriptions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, credit FROM banking.subscriptions WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get sum of credit by reconciliation_status from subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, SUM(credit) AS sum_credit FROM banking.subscriptions GROUP BY reconciliation_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_number, reconciliation_status, invoice_id for every subscription.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, invoice_id FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, invoice_id FROM banking.subscriptions ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, reconciliation_status, invoice_id FROM banking.subscriptions ORDER BY user_id ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.subscriptions (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reconciliation_status char,\n invoice_number varchar NOT NULL,\n credit character varying(128),\n vendor_id varchar,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE banking.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n state character varying(64) NOT NULL,\n password_hash text,\n phone text,\n status varchar NOT NULL,\n language varchar NOT NULL,\n bio character varying(64) NOT NULL,\n token varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_id, created_at, user_id for every subscription.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, created_at, user_id FROM banking.subscriptions;", "sql": null}, {"role": "user", "content": "Show me subscriptions with invoice_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, created_at, user_id FROM banking.subscriptions WHERE invoice_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, created_at, user_id FROM banking.subscriptions WHERE invoice_id LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp,\n state character varying(256) NOT NULL,\n postal_code varchar,\n timezone char NOT NULL,\n parking_available character varying(256) NOT NULL,\n description character varying(128),\n country character varying(128) NOT NULL,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE music.posts (\n content_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n user_id character varying(64),\n likes text,\n format varchar,\n good_id integer NOT NULL -- reference to goods.barcode,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (good_id) REFERENCES goods(barcode),\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE music.transactions (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_status char,\n fee character varying(256),\n delivery_status char NOT NULL,\n exchange_rate text\n)\n\nCREATE TABLE music.goods (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at date,\n video_url text NOT NULL,\n image_url character varying(256) NOT NULL,\n popularity_score char NOT NULL,\n media_url char,\n featured_rank character varying(128),\n venue_id text -- reference to venues.id,\n FOREIGN KEY (venue_id) REFERENCES venues(id)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.goods;", "sql": null}, {"role": "user", "content": "Can you order these by venue_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.goods ORDER BY venue_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.goods ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp,\n state character varying(256) NOT NULL,\n postal_code varchar,\n timezone char NOT NULL,\n parking_available character varying(256) NOT NULL,\n description character varying(128),\n country character varying(128) NOT NULL,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE music.posts (\n content_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n user_id character varying(64),\n likes text,\n format varchar,\n good_id integer NOT NULL -- reference to goods.barcode,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (good_id) REFERENCES goods(barcode),\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE music.transactions (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_status char,\n fee character varying(256),\n delivery_status char NOT NULL,\n exchange_rate text\n)\n\nCREATE TABLE music.goods (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at date,\n video_url text NOT NULL,\n image_url character varying(256) NOT NULL,\n popularity_score char NOT NULL,\n media_url char,\n featured_rank character varying(128),\n venue_id text -- reference to venues.id,\n FOREIGN KEY (venue_id) REFERENCES venues(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.goods;", "sql": null}, {"role": "user", "content": "Retrieve goods where venue_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.goods WHERE venue_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group goods by venue_id and show the min of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, MIN(published_at) AS min_published_at FROM music.goods GROUP BY venue_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp,\n state character varying(256) NOT NULL,\n postal_code varchar,\n timezone char NOT NULL,\n parking_available character varying(256) NOT NULL,\n description character varying(128),\n country character varying(128) NOT NULL,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE music.posts (\n content_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n user_id character varying(64),\n likes text,\n format varchar,\n good_id integer NOT NULL -- reference to goods.barcode,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (good_id) REFERENCES goods(barcode),\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE music.transactions (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_status char,\n fee character varying(256),\n delivery_status char NOT NULL,\n exchange_rate text\n)\n\nCREATE TABLE music.goods (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at date,\n video_url text NOT NULL,\n image_url character varying(256) NOT NULL,\n popularity_score char NOT NULL,\n media_url char,\n featured_rank character varying(128),\n venue_id text -- reference to venues.id,\n FOREIGN KEY (venue_id) REFERENCES venues(id)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts;", "sql": null}, {"role": "user", "content": "List posts with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts WHERE published_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp,\n state character varying(256) NOT NULL,\n postal_code varchar,\n timezone char NOT NULL,\n parking_available character varying(256) NOT NULL,\n description character varying(128),\n country character varying(128) NOT NULL,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE music.posts (\n content_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n user_id character varying(64),\n likes text,\n format varchar,\n good_id integer NOT NULL -- reference to goods.barcode,\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (good_id) REFERENCES goods(barcode),\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE music.transactions (\n id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_status char,\n fee character varying(256),\n delivery_status char NOT NULL,\n exchange_rate text\n)\n\nCREATE TABLE music.goods (\n barcode integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n expires_at date,\n video_url text NOT NULL,\n image_url character varying(256) NOT NULL,\n popularity_score char NOT NULL,\n media_url char,\n featured_rank character varying(128),\n venue_id text -- reference to venues.id,\n FOREIGN KEY (venue_id) REFERENCES venues(id)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts;", "sql": null}, {"role": "user", "content": "Can you order these by good_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts ORDER BY good_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.posts ORDER BY good_id ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "List currency, notification_id, processed_at from orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, notification_id, processed_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, notification_id, processed_at FROM tradingplatform.orders ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by currency descending?", "sql": null}, {"role": "assistant", "content": "SELECT currency, notification_id, processed_at FROM tradingplatform.orders ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "What are the delivery_status, currency, processed_at of each order?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, currency, processed_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, currency, processed_at FROM tradingplatform.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, currency, processed_at FROM tradingplatform.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List currency, processed_at, payer_id, notes for each order along with their notification information.", "sql": null}, {"role": "assistant", "content": "SELECT *, notifications.payer_id, notifications.notes FROM tradingplatform.orders JOIN tradingplatform.notifications ON orders.notification_id = notifications.id;", "sql": null}, {"role": "user", "content": "Show me sum of updated_at grouped by updated_at for orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(updated_at) AS sum_updated_at FROM tradingplatform.orders GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Get currency, processed_at, notification_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, notification_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders where fee LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, processed_at, notification_id FROM tradingplatform.orders WHERE fee LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Get currency, updated_at, user_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, updated_at, user_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What fee, updated_at, notes, updated_at do we have for orders and their associated notifications?", "sql": null}, {"role": "assistant", "content": "SELECT currency, updated_at, user_id, notifications.notes, notifications.updated_at FROM tradingplatform.orders JOIN tradingplatform.notifications ON orders.notification_id = notifications.id;", "sql": null}, {"role": "user", "content": "What is the average currency for each notification_id in orders?", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, AVERAGE(currency) AS average_currency FROM tradingplatform.orders GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Get fee, user_id, updated_at from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT fee, user_id, updated_at FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT fee, user_id, updated_at FROM tradingplatform.orders WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT fee, user_id, updated_at FROM tradingplatform.orders WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "What are the processed_at, updated_at, id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Can you order these by user_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, id FROM tradingplatform.orders ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, id FROM tradingplatform.orders ORDER BY user_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n notes character varying(64) NOT NULL,\n payer_id varchar\n)\n\nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at timestamp without time zone,\n delivery_status character varying(64),\n user_id character varying(64) -- identifier for user,\n fee text NOT NULL,\n currency varchar NOT NULL,\n notification_id text NOT NULL -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Find branches where city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of id for each timezone in branches.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MAX(id) AS max_id FROM transportation.branches GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches;", "sql": null}, {"role": "user", "content": "What city, geo_point, updated_at, verification_status do we have for branches and their associated payments?", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.updated_at, payments.verification_status FROM transportation.branches JOIN transportation.payments ON branches.payment_id = payments.account_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.updated_at, payments.verification_status FROM transportation.branches JOIN transportation.payments ON branches.payment_id = payments.account_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Get all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Show the results sorted by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "What is the max updated_at for each geo_point in branches?", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, MAX(updated_at) AS max_updated_at FROM transportation.branches GROUP BY geo_point;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, city, payment_id of each branche?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, payment_id FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, payment_id FROM transportation.branches ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by id descending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, city, payment_id FROM transportation.branches ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, geo_point, payment_id for every branche.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, payment_id FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Get branches that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, payment_id FROM transportation.branches WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by geo_point ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, payment_id FROM transportation.branches WHERE updated_at > '2023-01-01' ORDER BY geo_point ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Group branches by city and show the count of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(updated_at) AS count_updated_at FROM transportation.branches GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Show me all branches.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM transportation.branches;", "sql": null}, {"role": "user", "content": "What city, timezone, updated_at, status do we have for branches and their associated payments?", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.updated_at, payments.status FROM transportation.branches JOIN transportation.payments ON branches.payment_id = payments.account_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.updated_at, payments.status FROM transportation.branches JOIN transportation.payments ON branches.payment_id = payments.account_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, payment_id, city from all branches.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_id, city FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Find branches where city LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_id, city FROM transportation.branches WHERE city LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_id, city FROM transportation.branches WHERE city LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "List geo_point, timezone, payment_id from branches.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, timezone, payment_id FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Retrieve branches where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, timezone, payment_id FROM transportation.branches WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of branches across different city values.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM transportation.branches GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE transportation.payments (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n customer_id char NOT NULL -- identifier for customer,\n status character varying(64),\n verification_status character varying(64) NOT NULL\n)\n\nCREATE TABLE transportation.sales (\n payment_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n total decimal,\n approval_status character varying(128),\n product_id char,\n amount numeric,\n customer_id character varying(64),\n buyer_id varchar\n)\n\nCREATE TABLE transportation.branches (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n timezone text,\n city character varying(256) NOT NULL,\n geo_point varchar,\n payment_id text -- reference to payments.account_id,\n FOREIGN KEY (payment_id) REFERENCES payments(account_id)\n)", "conversations": [{"role": "user", "content": "Get city, payment_id, timezone from all branches.", "sql": null}, {"role": "assistant", "content": "SELECT city, payment_id, timezone FROM transportation.branches;", "sql": null}, {"role": "user", "content": "Show me branches that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT city, payment_id, timezone FROM transportation.branches WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT city, payment_id, timezone FROM transportation.branches WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve keywords, message_id, updated_at for every comment.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, message_id, updated_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where like_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, message_id, updated_at FROM socialmedia.comments WHERE like_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of comments grouped by reply_to_id.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY reply_to_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show me likes with state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by location_lat ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE state LIKE 'A%' ORDER BY location_lat ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me zip_code, like_id, last_active for all users.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, like_id, last_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve api_key, last_active, country, location_lat showing the relationship between users and likes.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, like_id, last_active, likes.country, likes.location_lat FROM socialmedia.users JOIN socialmedia.likes ON users.like_id = likes.venue_id;", "sql": null}, {"role": "user", "content": "Get sum of zip_code by zip_code from users.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, SUM(zip_code) AS sum_zip_code FROM socialmedia.users GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Get keywords, tags, created_at from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, tags, created_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me shares, like_id, updated_at, name from comments and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, tags, created_at, likes.updated_at, likes.name FROM socialmedia.comments JOIN socialmedia.likes ON comments.like_id = likes.venue_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, tags, created_at, likes.updated_at, likes.name FROM socialmedia.comments JOIN socialmedia.likes ON comments.like_id = likes.venue_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get body, keywords, category, last_inspected by joining comments with likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.category, likes.last_inspected FROM socialmedia.comments JOIN socialmedia.likes ON comments.like_id = likes.venue_id;", "sql": null}, {"role": "user", "content": "Get max of keywords by keywords from comments.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, MAX(keywords) AS max_keywords FROM socialmedia.comments GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get users that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Get location_lat, last_inspected, name from all likes.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, last_inspected, name FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Sort the results by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, last_inspected, name FROM socialmedia.likes ORDER BY last_inspected ASC;", "sql": null}, {"role": "user", "content": "Group likes by category and show the min of location_lat.", "sql": null}, {"role": "assistant", "content": "SELECT category, MIN(location_lat) AS min_location_lat FROM socialmedia.likes GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Sort the results by api_key ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY api_key ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE last_inspected > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n country character varying(128) NOT NULL,\n timezone text,\n name varchar,\n postal_code varchar,\n category varchar,\n state char NOT NULL,\n location_lat character varying(256),\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE socialmedia.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n api_key char,\n language text NOT NULL,\n zip_code char,\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n shares text,\n reply_to_id character varying(64) -- identifier for reply_to,\n tags character varying(128) NOT NULL,\n keywords text,\n categories varchar,\n body character varying(128),\n media_url character varying(128),\n like_id text NOT NULL -- reference to likes.venue_id,\n FOREIGN KEY (like_id) REFERENCES likes(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by state ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY state ASC;", "sql": null}, {"role": "user", "content": "Tally up likes by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM socialmedia.likes GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve id, thumbnail_url, comment_id for every product.", "sql": null}, {"role": "assistant", "content": "SELECT id, thumbnail_url, comment_id FROM music.products;", "sql": null}, {"role": "user", "content": "List products with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT id, thumbnail_url, comment_id FROM music.products WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Calculate max of expires_at for each expires_at in products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, MAX(expires_at) AS max_expires_at FROM music.products GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me expires_at, tax_rate, id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, tax_rate, id FROM music.products;", "sql": null}, {"role": "user", "content": "Retrieve expires_at, id, reply_to_id, updated_at showing the relationship between products and comments.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, tax_rate, id, comments.reply_to_id, comments.updated_at FROM music.products JOIN music.comments ON products.comment_id = comments.comment_id;", "sql": null}, {"role": "user", "content": "What is the sum thumbnail_url for each expires_at in products?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, SUM(thumbnail_url) AS sum_thumbnail_url FROM music.products GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "List tax_rate, thumbnail_url, expires_at from products.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, thumbnail_url, expires_at FROM music.products;", "sql": null}, {"role": "user", "content": "Show me quantity, tax_rate, reply_to_id, subject from products and their related comments.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, thumbnail_url, expires_at, comments.reply_to_id, comments.subject FROM music.products JOIN music.comments ON products.comment_id = comments.comment_id;", "sql": null}, {"role": "user", "content": "Order the output by comment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, thumbnail_url, expires_at, comments.reply_to_id, comments.subject FROM music.products JOIN music.comments ON products.comment_id = comments.comment_id ORDER BY comment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me thumbnail_url, quantity, expires_at for all products.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, quantity, expires_at FROM music.products;", "sql": null}, {"role": "user", "content": "Show the results sorted by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, quantity, expires_at FROM music.products ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by comment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, quantity, expires_at FROM music.products ORDER BY comment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products WHERE expires_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products;", "sql": null}, {"role": "user", "content": "Get thumbnail_url, quantity, categories, created_at by joining products with comments.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.categories, comments.created_at FROM music.products JOIN music.comments ON products.comment_id = comments.comment_id;", "sql": null}, {"role": "user", "content": "Count the number of products in each comment_id category.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM music.products GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products;", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products ORDER BY thumbnail_url ASC;", "sql": null}, {"role": "user", "content": "Order the output by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me comment_id, tax_rate, id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, tax_rate, id FROM music.products;", "sql": null}, {"role": "user", "content": "What quantity, comment_id, created_at, reply_to_id do we have for products and their associated comments?", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, tax_rate, id, comments.created_at, comments.reply_to_id FROM music.products JOIN music.comments ON products.comment_id = comments.comment_id;", "sql": null}, {"role": "user", "content": "What is the sum expires_at for each comment_id in products?", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, SUM(expires_at) AS sum_expires_at FROM music.products GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "List id, expires_at, tax_rate from products.", "sql": null}, {"role": "assistant", "content": "SELECT id, expires_at, tax_rate FROM music.products;", "sql": null}, {"role": "user", "content": "Retrieve products where quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT id, expires_at, tax_rate FROM music.products WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of tax_rate for each id in products.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(tax_rate) AS count_tax_rate FROM music.products GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp,\n categories character varying(64) NOT NULL,\n reply_to_id char -- identifier for reply_to,\n subject text\n)\n\nCREATE TABLE music.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n quantity character varying(64) NOT NULL,\n thumbnail_url varchar,\n tax_rate character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products;", "sql": null}, {"role": "user", "content": "Show the results sorted by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.products ORDER BY comment_id ASC;", "sql": null}, {"role": "user", "content": "Get count of thumbnail_url by id from products.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(thumbnail_url) AS count_thumbnail_url FROM music.products GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match buyer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE buyer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by tax descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE buyer_id LIKE 'A%' ORDER BY tax DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "List exchange_rate, tax, status from audits.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, tax, status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, tax, status FROM finance.audits WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of card_type grouped by status for audits.", "sql": null}, {"role": "assistant", "content": "SELECT status, MIN(card_type) AS min_card_type FROM finance.audits GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with last_login in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY last_login ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by username descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY username DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Get fee, buyer_id, card_type from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT fee, buyer_id, card_type FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT fee, buyer_id, card_type FROM finance.audits WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT fee, buyer_id, card_type FROM finance.audits WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by employee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY employee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "What are the account_id, payee_id, status of each account?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payee_id, status FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payee_id, status FROM finance.accounts WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by due_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payee_id, status FROM finance.accounts WHERE approval_status LIKE 'A%' ORDER BY due_date DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Show me last_login, employee_id, username for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, employee_id, username FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, employee_id, username FROM finance.customers WHERE last_login > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of customers in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.customers GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "What are the status, completed_at, card_type of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT status, completed_at, card_type FROM finance.audits;", "sql": null}, {"role": "user", "content": "Sort the results by buyer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, completed_at, card_type FROM finance.audits ORDER BY buyer_id DESC;", "sql": null}, {"role": "user", "content": "What is the min exchange_rate for each completed_at in audits?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, MIN(exchange_rate) AS min_exchange_rate FROM finance.audits GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "List tax, fee, status from audits.", "sql": null}, {"role": "assistant", "content": "SELECT tax, fee, status FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by tax ascending.", "sql": null}, {"role": "assistant", "content": "SELECT tax, fee, status FROM finance.audits ORDER BY tax ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by tax ascending.", "sql": null}, {"role": "assistant", "content": "SELECT tax, fee, status FROM finance.audits ORDER BY tax ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n status character varying(256) NOT NULL,\n buyer_id text NOT NULL -- identifier for buyer,\n tax smallint,\n card_type char NOT NULL,\n exchange_rate varchar,\n fee text\n)\n\nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n zip_code character varying(256),\n last_login timestamp without time zone,\n language character varying(64),\n username text NOT NULL\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n status character varying(256),\n payee_id character varying(64) -- identifier for payee,\n approval_status text\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me tax_rate, image_url, media_url for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, image_url, media_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Arrange the results with order_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, image_url, media_url FROM tradingplatform.assets ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, image_url, media_url FROM tradingplatform.assets ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up orders by payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM tradingplatform.orders GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get order_id, published_at, created_at from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, published_at, created_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get all assets older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, published_at, created_at FROM tradingplatform.assets WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, published_at, created_at FROM tradingplatform.assets WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Sort the results by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY featured_rank DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY featured_rank DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Get featured_rank, image_url, tax_rate from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, image_url, tax_rate FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get media_url, published_at, payment_method, tax by joining assets with orders.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, image_url, tax_rate, orders.payment_method, orders.tax FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.order_id;", "sql": null}, {"role": "user", "content": "Sort the results by tax_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, image_url, tax_rate, orders.payment_method, orders.tax FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.order_id ORDER BY tax_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where order_id > 78.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE order_id > 78;", "sql": null}, {"role": "user", "content": "What is the max media_url for each media_url in assets?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, MAX(media_url) AS max_media_url FROM tradingplatform.assets GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List payment_status, tax, exchange_rate from orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, tax, exchange_rate FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve created_at, exchange_rate, image_url, description showing the relationship between orders and assets.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, tax, exchange_rate, assets.image_url, assets.description FROM tradingplatform.orders JOIN tradingplatform.assets ON orders.asset_id = assets.barcode;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, tax, exchange_rate, assets.image_url, assets.description FROM tradingplatform.orders JOIN tradingplatform.assets ON orders.asset_id = assets.barcode LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "Show me order_id, description, created_at for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, description, created_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, description, created_at FROM tradingplatform.assets WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, description, created_at FROM tradingplatform.assets WHERE published_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average published_at for each image_url in assets?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, AVERAGE(published_at) AS average_published_at FROM tradingplatform.assets GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n order_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n created_at timestamp without time zone,\n payment_method varchar NOT NULL,\n payment_status text,\n exchange_rate character varying(128) NOT NULL,\n tax decimal NOT NULL,\n approval_status character varying(128) NOT NULL,\n asset_id text NOT NULL -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n image_url character varying(128),\n description character varying(64) NOT NULL,\n available character varying(256) NOT NULL,\n media_url character varying(128),\n tax_rate character varying(64) NOT NULL,\n featured_rank character varying(128),\n order_id integer NOT NULL -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by tax.", "sql": null}, {"role": "assistant", "content": "SELECT tax, COUNT(*) AS count FROM tradingplatform.orders GROUP BY tax ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List avatar, is_verified, updated_at, nationality for each department along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.updated_at, patients.nationality FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Calculate min of patient_id for each updated_at in departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(patient_id) AS min_patient_id FROM healthcare.departments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Group departments by avatar and show the count of avatar.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, COUNT(avatar) AS count_avatar FROM healthcare.departments GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE last_login = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "How many billing are there per employee_id?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, COUNT(*) AS count FROM healthcare.billing GROUP BY employee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List joined_at, avatar, last_login from departments.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, avatar, last_login FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, avatar, last_login FROM healthcare.departments WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with patient_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, avatar, last_login FROM healthcare.departments WHERE joined_at > '2023-01-01' ORDER BY patient_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me is_verified, bio, timezone for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, bio, timezone FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, bio, timezone FROM healthcare.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the sum updated_at for each timezone in departments?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, SUM(updated_at) AS sum_updated_at FROM healthcare.departments GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List timezone, last_login, is_verified from departments.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, is_verified FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, is_verified FROM healthcare.departments ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with patient_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, is_verified FROM healthcare.departments ORDER BY patient_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List age, phone, updated_at from billing.", "sql": null}, {"role": "assistant", "content": "SELECT age, phone, updated_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT age, phone, updated_at FROM healthcare.billing WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT age, phone, updated_at FROM healthcare.billing WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY employee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at timestamp,\n timezone character varying(128),\n is_verified boolean -- indicates if verified is true,\n bio character varying(128),\n avatar varchar,\n last_login timestamp,\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n first_name char,\n nationality varchar,\n address character varying(128),\n membership_level varchar\n)\n\nCREATE TABLE healthcare.billing (\n employee_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n age character varying(128),\n last_login timestamp without time zone NOT NULL,\n salt character varying(64),\n phone character varying(64),\n patient_id integer -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "What are the avatar, joined_at, bio of each department?", "sql": null}, {"role": "assistant", "content": "SELECT avatar, joined_at, bio FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get departments that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, joined_at, bio FROM healthcare.departments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of departments grouped by last_login.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, COUNT(*) AS count FROM healthcare.departments GROUP BY last_login ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Show me image_url, edited_at, follower_id for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, edited_at, follower_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve follower_id, edited_at, expires_at, tax_rate showing the relationship between comments and followers.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, edited_at, follower_id, followers.expires_at, followers.tax_rate FROM socialmedia.comments JOIN socialmedia.followers ON comments.follower_id = followers.id;", "sql": null}, {"role": "user", "content": "What is the count user_id for each follower_id in comments?", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(user_id) AS count_user_id FROM socialmedia.comments GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up comments by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve message_id, score, format for every message.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, score, format FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get messages that match categories LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, score, format FROM socialmedia.messages WHERE categories LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of description for each score in messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, AVERAGE(description) AS average_description FROM socialmedia.messages GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of comments grouped by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me edited_at, user_id, created_at, expires_at from comments and their related followers.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.expires_at FROM socialmedia.comments JOIN socialmedia.followers ON comments.follower_id = followers.id;", "sql": null}, {"role": "user", "content": "Show me min of follower_id grouped by user_id for comments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(follower_id) AS min_follower_id FROM socialmedia.comments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments with image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Order the output by follower_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY follower_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of comments in each follower_id category.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by follower_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%' ORDER BY follower_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "What are the edited_at, author_id, message_id of each message?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, author_id, message_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, author_id, message_id FROM socialmedia.messages WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group messages by categories and show the average of edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT categories, AVERAGE(edited_at) AS average_edited_at FROM socialmedia.messages GROUP BY categories;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp,\n categories varchar NOT NULL,\n author_id character varying(128) NOT NULL -- identifier for author,\n reply_to_id character varying(64) -- identifier for reply_to,\n description text,\n score character varying(128),\n format character varying(64) NOT NULL,\n follower_id text NOT NULL -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)\n\nCREATE TABLE socialmedia.followers (\n id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n description character varying(256),\n tax_rate character varying(256) NOT NULL,\n category char,\n currency varchar\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n image_url character varying(256),\n user_id varchar -- identifier for user,\n follower_id text -- reference to followers.id,\n FOREIGN KEY (follower_id) REFERENCES followers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve score, format, author_id for every message.", "sql": null}, {"role": "assistant", "content": "SELECT score, format, author_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Can you order these by reply_to_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT score, format, author_id FROM socialmedia.messages ORDER BY reply_to_id DESC;", "sql": null}, {"role": "user", "content": "Get average of edited_at by description from messages.", "sql": null}, {"role": "assistant", "content": "SELECT description, AVERAGE(edited_at) AS average_edited_at FROM socialmedia.messages GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by salt descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active <= CURRENT_DATE - INTERVAL '6 months' ORDER BY salt DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get description, updated_at, reserved from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT description, updated_at, reserved FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT description, updated_at, reserved FROM healthcare.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different name values.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM healthcare.departments GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, tax_rate, thumbnail_url of each department?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, tax_rate, thumbnail_url FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get thumbnail_url, quantity, display_name, department_id by joining departments with patients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, tax_rate, thumbnail_url, patients.display_name, patients.department_id FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Calculate sum of thumbnail_url for each patient_id in departments.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, SUM(thumbnail_url) AS sum_thumbnail_url FROM healthcare.departments GROUP BY patient_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get gender, age, last_active from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT gender, age, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get salt, gender, created_at, patient_id by joining patients with departments.", "sql": null}, {"role": "assistant", "content": "SELECT gender, age, last_active, departments.created_at, departments.patient_id FROM healthcare.patients JOIN healthcare.departments ON patients.department_id = departments.product_id;", "sql": null}, {"role": "user", "content": "Arrange the results with nationality in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT gender, age, last_active, departments.created_at, departments.patient_id FROM healthcare.patients JOIN healthcare.departments ON patients.department_id = departments.product_id ORDER BY nationality DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Show me gender, salt, department_id for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT gender, salt, department_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have department_id > 5.", "sql": null}, {"role": "assistant", "content": "SELECT gender, salt, department_id FROM healthcare.patients WHERE department_id > 5;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT gender, salt, department_id FROM healthcare.patients WHERE department_id > 5 LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "List age, display_name, department_id from patients.", "sql": null}, {"role": "assistant", "content": "SELECT age, display_name, department_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT age, display_name, department_id FROM healthcare.patients WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT age, display_name, department_id FROM healthcare.patients WHERE last_active = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "What are the name, tax_rate, quantity of each department?", "sql": null}, {"role": "assistant", "content": "SELECT name, tax_rate, quantity FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT name, tax_rate, quantity FROM healthcare.departments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT name, tax_rate, quantity FROM healthcare.departments WHERE description LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Get patient_id, updated_at, tax_rate from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, updated_at, tax_rate FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me tax_rate, updated_at, gender, salt from departments and their related patients.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, updated_at, tax_rate, patients.gender, patients.salt FROM healthcare.departments JOIN healthcare.patients ON departments.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different updated_at values.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM healthcare.departments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group patients by age and show the sum of department_id.", "sql": null}, {"role": "assistant", "content": "SELECT age, SUM(department_id) AS sum_department_id FROM healthcare.patients GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n thumbnail_url varchar,\n tax_rate character varying(128) NOT NULL,\n quantity character varying(64),\n reserved character varying(64) NOT NULL,\n description text,\n name char,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n salt char,\n gender character varying(64) NOT NULL,\n display_name character varying(64) NOT NULL,\n nationality character varying(128) NOT NULL,\n age character varying(256),\n department_id integer -- reference to departments.product_id,\n FOREIGN KEY (department_id) REFERENCES departments(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, patient_id, tax_rate for every department.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, patient_id, tax_rate FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, patient_id, tax_rate FROM healthcare.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me count of quantity grouped by updated_at for departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(quantity) AS count_quantity FROM healthcare.departments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many loans are there per currency?", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM finance.loans GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me created_at, gender, timezone for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, gender, timezone FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with gender in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, gender, timezone FROM finance.customers ORDER BY gender DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different timezone values.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM finance.customers GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "List api_key, first_name, timezone from customers.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, first_name, timezone FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by api_key ascending.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, first_name, timezone FROM finance.customers ORDER BY api_key ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, first_name, timezone FROM finance.customers ORDER BY api_key ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY customer_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve payee_id, customer_id, category for every loan.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, customer_id, category FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show the results sorted by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, customer_id, category FROM finance.loans ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of loans across different payee_id values.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, COUNT(*) AS count FROM finance.loans GROUP BY payee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of customers in each timezone category.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM finance.customers GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "List category, id, currency from loans.", "sql": null}, {"role": "assistant", "content": "SELECT category, id, currency FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT category, id, currency FROM finance.loans WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with customer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, id, currency FROM finance.loans WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Arrange the results with id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match full_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE full_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE full_name LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n currency character varying(64),\n payee_id character varying(64) -- identifier for payee,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n category character varying(64)\n)\n\nCREATE TABLE finance.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n gender text,\n status character varying(64),\n birth_date timestamp,\n first_name character varying(64),\n timezone varchar NOT NULL,\n full_name character varying(64),\n api_key character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Arrange the results with category in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Show me the count of loans grouped by payee_id.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, COUNT(*) AS count FROM finance.loans GROUP BY payee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY featured_rank DESC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY featured_rank DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "List transaction_id, backorder, featured_rank from audits.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, backorder, featured_rank FROM finance.audits;", "sql": null}, {"role": "user", "content": "Arrange the results with available in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, backorder, featured_rank FROM finance.audits ORDER BY available DESC;", "sql": null}, {"role": "user", "content": "Show me sum of currency grouped by description for audits.", "sql": null}, {"role": "assistant", "content": "SELECT description, SUM(currency) AS sum_currency FROM finance.audits GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get description, featured_rank, available from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, available FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, available FROM finance.audits WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, available FROM finance.audits WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get description, transaction_id, featured_rank from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT description, transaction_id, featured_rank FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, transaction_id, featured_rank FROM finance.audits ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show me the count of audits grouped by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM finance.audits GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me description, transaction_id, updated_at for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT description, transaction_id, updated_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, transaction_id, updated_at FROM finance.audits ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, transaction_id, updated_at FROM finance.audits ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of currency for each backorder in audits.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, MIN(currency) AS min_currency FROM finance.audits GROUP BY backorder;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me available, updated_at, backorder for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT available, updated_at, backorder FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT available, updated_at, backorder FROM finance.audits WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate min of updated_at for each backorder in audits.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, MIN(updated_at) AS min_updated_at FROM finance.audits GROUP BY backorder;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get currency, description, updated_at from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT currency, description, updated_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT currency, description, updated_at FROM finance.audits WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT currency, description, updated_at FROM finance.audits WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve available, currency, backorder for every audit.", "sql": null}, {"role": "assistant", "content": "SELECT available, currency, backorder FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT available, currency, backorder FROM finance.audits WHERE available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of audits in each featured_rank category.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM finance.audits GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n item_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n description char,\n backorder character varying(256),\n available varchar,\n currency char NOT NULL,\n featured_rank character varying(128),\n transaction_id text NOT NULL -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.transactions (\n id varchar PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n amount numeric,\n payment_method character varying(128),\n buyer_id varchar,\n exchange_rate text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me featured_rank, available, description for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, available, description FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, available, description FROM finance.audits ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, available, description FROM finance.audits ORDER BY description ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, last_inspected, zip_code of each store?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_inspected, zip_code FROM marketing.stores;", "sql": null}, {"role": "user", "content": "List stores that have zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_inspected, zip_code FROM marketing.stores WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, last_inspected, zip_code FROM marketing.stores WHERE zip_code LIKE 'A%' ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Display all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Can you order these by last_inspected descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores ORDER BY last_inspected DESC;", "sql": null}, {"role": "user", "content": "Show me count of capacity grouped by zip_code for stores.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(capacity) AS count_capacity FROM marketing.stores GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Display all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Sort the results by latitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores ORDER BY latitude ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "List last_inspected, purchase_id, updated_at from stores.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, purchase_id, updated_at FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Show me stores with timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, purchase_id, updated_at FROM marketing.stores WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, purchase_id, updated_at FROM marketing.stores WHERE timezone LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods;", "sql": null}, {"role": "user", "content": "Show the results sorted by popularity_score ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods ORDER BY popularity_score ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods ORDER BY popularity_score ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Retrieve purchase_id, updated_at, completed_at, processed_at showing the relationship between stores and purchases.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.completed_at, purchases.processed_at FROM marketing.stores JOIN marketing.purchases ON stores.purchase_id = purchases.order_id;", "sql": null}, {"role": "user", "content": "What is the average purchase_id for each last_inspected in stores?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, AVERAGE(purchase_id) AS average_purchase_id FROM marketing.stores GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "List all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Get all stores created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.stores WHERE last_inspected >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Get all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods;", "sql": null}, {"role": "user", "content": "List goods that have video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.goods WHERE video_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Get all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where total > 85.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.purchases WHERE total > 85;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.purchases WHERE total > 85 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.goods (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n description varchar,\n available character varying(128),\n video_url character varying(256) NOT NULL -- identifier for video_url,\n title char,\n popularity_score varchar,\n purchase_id integer -- reference to purchases.order_id,\n store_id integer -- reference to stores.store_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id),\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.purchases (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n completed_at timestamp,\n buyer_id character varying(64),\n exchange_rate character varying(128) NOT NULL,\n total integer,\n currency char,\n store_id integer NOT NULL -- reference to stores.store_id,\n FOREIGN KEY (store_id) REFERENCES stores(store_id)\n)\n\nCREATE TABLE marketing.stores (\n store_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at date,\n capacity character varying(64) NOT NULL,\n timezone character varying(64),\n latitude character varying(128) NOT NULL,\n location_lat character varying(256),\n zip_code character varying(256),\n purchase_id integer -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)", "conversations": [{"role": "user", "content": "Get capacity, zip_code, purchase_id from all stores.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, zip_code, purchase_id FROM marketing.stores;", "sql": null}, {"role": "user", "content": "Sort the results by location_lat descending.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, zip_code, purchase_id FROM marketing.stores ORDER BY location_lat DESC;", "sql": null}, {"role": "user", "content": "Tally up stores by zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(*) AS count FROM marketing.stores GROUP BY zip_code ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Show me processed_at, status, subtotal for all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, subtotal FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, subtotal FROM healthcare.appointments WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with card_type in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, subtotal FROM healthcare.appointments WHERE processed_at > '2023-01-01' ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments where status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE status LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "List membership_level, language, nationality from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, language, nationality FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Arrange the results with phone in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, language, nationality FROM healthcare.medical_records ORDER BY phone ASC;", "sql": null}, {"role": "user", "content": "Get count of created_at by created_at from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(created_at) AS count_created_at FROM healthcare.medical_records GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Retrieve phone, password_hash, language for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT phone, password_hash, language FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Can you order these by phone ascending?", "sql": null}, {"role": "assistant", "content": "SELECT phone, password_hash, language FROM healthcare.medical_records ORDER BY phone ASC;", "sql": null}, {"role": "user", "content": "Group medical_records by language and show the average of joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT language, AVERAGE(joined_at) AS average_joined_at FROM healthcare.medical_records GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Get last_login, joined_at, nationality from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, joined_at, nationality FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve medical_records where nationality LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, joined_at, nationality FROM healthcare.medical_records WHERE nationality LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many medical_records are there per joined_at?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by nationality descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE joined_at > '2023-01-01' ORDER BY nationality DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Sort the results by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY subtotal DESC;", "sql": null}, {"role": "user", "content": "What is the sum processed_at for each card_type in appointments?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, SUM(processed_at) AS sum_processed_at FROM healthcare.appointments GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with password_hash in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at > '2023-12-01' ORDER BY password_hash ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "Retrieve order_id, processed_at, card_type for every appointment.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, processed_at, card_type FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments where processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, processed_at, card_type FROM healthcare.appointments WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, processed_at, card_type FROM healthcare.appointments WHERE processed_at > '2023-01-01' ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n card_type text NOT NULL,\n subtotal integer,\n status varchar\n)\n\nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n created_at date,\n password_hash character varying(64),\n phone character varying(64) NOT NULL,\n language text,\n age character varying(128),\n nationality character varying(128),\n membership_level text NOT NULL,\n last_login timestamp without time zone\n)", "conversations": [{"role": "user", "content": "What are the order_id, card_type, subtotal of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, card_type, subtotal FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, card_type, subtotal FROM healthcare.appointments WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of appointments across different card_type values.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM healthcare.appointments GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List subtotal, created_at, exchange_rate from orders.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, exchange_rate FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by currency descending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, exchange_rate FROM e-commerce.orders ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, created_at, exchange_rate FROM e-commerce.orders ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get currency, created_at, card_type from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, card_type FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What exchange_rate, inventor_id, published_at, available do we have for orders and their associated inventory?", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, card_type, inventory.published_at, inventory.available FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.item_id;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, card_type, inventory.published_at, inventory.available FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.item_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by price ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY price ASC;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List currency, inventor_id, price from orders.", "sql": null}, {"role": "assistant", "content": "SELECT currency, inventor_id, price FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, inventor_id, price FROM e-commerce.orders ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Count the number of orders in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM e-commerce.orders GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.order_items GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me order_id, status, api_key for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, status, api_key FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, status, api_key FROM e-commerce.order_items ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, status, api_key FROM e-commerce.order_items ORDER BY created_at ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "List orders that have card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of created_at by payment_method from orders.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, MIN(created_at) AS min_created_at FROM e-commerce.orders GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve completed_at, subtotal, inventor_id for every order.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, subtotal, inventor_id FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where inventor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, subtotal, inventor_id FROM e-commerce.orders WHERE inventor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM e-commerce.orders GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM e-commerce.order_items GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.order_items (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n is_active bit,\n is_verified bit,\n status character varying(128),\n api_key char NOT NULL,\n order_id text -- reference to orders.order_id,\n FOREIGN KEY (order_id) REFERENCES orders(order_id)\n)\n\nCREATE TABLE e-commerce.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp,\n exchange_rate character varying(64) NOT NULL,\n currency text,\n card_type character varying(256),\n payment_method character varying(128),\n subtotal bigint,\n price numeric(38,14),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n video_url text,\n available character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me exchange_rate, payment_method, created_at for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_method, created_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me card_type, created_at, available, tax_rate from orders and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_method, created_at, inventory.available, inventory.tax_rate FROM e-commerce.orders JOIN e-commerce.inventory ON orders.inventor_id = inventory.item_id;", "sql": null}, {"role": "user", "content": "Tally up orders by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve grade_id, video_url, views for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, video_url, views FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get video_url, thumbnail_url, reserved, updated_at by joining enrollments with grades.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, video_url, views, grades.reserved, grades.updated_at FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.sku;", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different grade_id values.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.enrollments GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Arrange the results with msrp in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY msrp DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY msrp DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me name, msrp, enrollment_id, department_id from enrollments and their related grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.enrollment_id, grades.department_id FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.sku;", "sql": null}, {"role": "user", "content": "Can you order these by name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.enrollment_id, grades.department_id FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.sku ORDER BY name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "List manufacturer, image_url, department_id from grades.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, image_url, department_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Get manufacturer, reserved, msrp, video_url by joining grades with enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, image_url, department_id, enrollments.msrp, enrollments.video_url FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.item_id;", "sql": null}, {"role": "user", "content": "Count the number of grades in each manufacturer category.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS count FROM education.grades GROUP BY manufacturer ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Get enrollment_id, department_id, brand from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, department_id, brand FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve enrollment_id, image_url, department_id, name showing the relationship between grades and enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT enrollment_id, department_id, brand, enrollments.department_id, enrollments.name FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.item_id;", "sql": null}, {"role": "user", "content": "How many grades are there per reserved?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM education.grades GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many grades are there per manufacturer?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS count FROM education.grades GROUP BY manufacturer ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me reserved, department_id, grade_id, thumbnail_url from grades and their related enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT *, enrollments.grade_id, enrollments.thumbnail_url FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.item_id;", "sql": null}, {"role": "user", "content": "Can you order these by manufacturer descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, enrollments.grade_id, enrollments.thumbnail_url FROM education.grades JOIN education.enrollments ON grades.enrollment_id = enrollments.item_id ORDER BY manufacturer DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Can you order these by enrollment_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY enrollment_id ASC;", "sql": null}, {"role": "user", "content": "Show me average of reserved grouped by manufacturer for grades.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, AVERAGE(reserved) AS average_reserved FROM education.grades GROUP BY manufacturer;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve msrp, grade_id, updated_at, reserved showing the relationship between enrollments and grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.updated_at, grades.reserved FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.sku;", "sql": null}, {"role": "user", "content": "Get count of msrp by msrp from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, COUNT(msrp) AS count_msrp FROM education.enrollments GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n reserved text,\n brand character varying(256) NOT NULL,\n manufacturer character varying(64),\n image_url text,\n enrollment_id text -- reference to enrollments.item_id,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(item_id),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.enrollments (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at date,\n name varchar NOT NULL,\n video_url character varying(256),\n views char NOT NULL,\n msrp varchar NOT NULL,\n thumbnail_url text,\n grade_id text NOT NULL -- reference to grades.sku,\n department_id integer NOT NULL -- reference to departments.transaction_id,\n FOREIGN KEY (grade_id) REFERENCES grades(sku),\n FOREIGN KEY (department_id) REFERENCES departments(transaction_id)\n)\n\nCREATE TABLE education.departments (\n transaction_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp,\n payee_id character varying(64),\n reconciliation_status text,\n reference_number character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve published_at, name, image_url, manufacturer showing the relationship between enrollments and grades.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.image_url, grades.manufacturer FROM education.enrollments JOIN education.grades ON enrollments.grade_id = grades.sku;", "sql": null}, {"role": "user", "content": "Show me max of grade_id grouped by department_id for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MAX(grade_id) AS max_grade_id FROM education.enrollments GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "List address, gender, language from patients.", "sql": null}, {"role": "assistant", "content": "SELECT address, gender, language FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get password_hash, timezone, created_at, payment_method by joining patients with departments.", "sql": null}, {"role": "assistant", "content": "SELECT address, gender, language, departments.created_at, departments.payment_method FROM healthcare.patients JOIN healthcare.departments ON patients.department_id = departments.order_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT address, gender, language, departments.created_at, departments.payment_method FROM healthcare.patients JOIN healthcare.departments ON patients.department_id = departments.order_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get user_id, updated_at, cost, views by joining departments with prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.cost, prescriptions.views FROM healthcare.departments JOIN healthcare.prescriptions ON departments.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Tally up departments by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM healthcare.departments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Get payment_method, price, tax from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, tax FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get currency, updated_at, created_at, media_url by joining departments with prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, tax, prescriptions.created_at, prescriptions.media_url FROM healthcare.departments JOIN healthcare.prescriptions ON departments.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Sort the results by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, tax, prescriptions.created_at, prescriptions.media_url FROM healthcare.departments JOIN healthcare.prescriptions ON departments.prescription_id = prescriptions.id ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Get tax, created_at, currency from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT tax, created_at, currency FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT tax, created_at, currency FROM healthcare.departments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_method in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT tax, created_at, currency FROM healthcare.departments ORDER BY payment_method ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, prescription_id, views, created_at showing the relationship between departments and prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.views, prescriptions.created_at FROM healthcare.departments JOIN healthcare.prescriptions ON departments.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Calculate average of tax for each payment_method in departments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(tax) AS average_tax FROM healthcare.departments GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate min of user_id for each updated_at in departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(user_id) AS min_user_id FROM healthcare.departments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get all departments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many departments are there per payment_method?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM healthcare.departments GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n order_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n user_id varchar -- identifier for user,\n tax bigint,\n currency character varying(128),\n price integer NOT NULL,\n payment_method character varying(256),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n views char NOT NULL,\n cost numeric,\n media_url character varying(64) NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n language text,\n address character varying(64),\n gender varchar NOT NULL,\n password_hash character varying(256),\n status char,\n timezone character varying(128),\n department_id text NOT NULL -- reference to departments.order_id,\n FOREIGN KEY (department_id) REFERENCES departments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me address, status, timezone for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT address, status, timezone FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients with address LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT address, status, timezone FROM healthcare.patients WHERE address LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of patients in each address category.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM healthcare.patients GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by invoice_number ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY invoice_number ASC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY invoice_number ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Get username, last_login, bio from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT username, last_login, bio FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get created_at, bio, invoice_number, vendor_id by joining customers with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT username, last_login, bio, accounts.invoice_number, accounts.vendor_id FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.invoice_id;", "sql": null}, {"role": "user", "content": "What is the min last_login for each bio in customers?", "sql": null}, {"role": "assistant", "content": "SELECT bio, MIN(last_login) AS min_last_login FROM finance.customers GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "What are the loan_id, customer_id, vendor_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, customer_id, vendor_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Order the output by loan_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, customer_id, vendor_id FROM finance.accounts ORDER BY loan_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by vendor_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, customer_id, vendor_id FROM finance.accounts ORDER BY vendor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me count of updated_at grouped by customer_id for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(updated_at) AS count_updated_at FROM finance.accounts GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "List all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by first_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE first_name LIKE 'A%' ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me first_name, last_name, last_active for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_name, last_active FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, last_name, last_active FROM finance.loans WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of loans in each full_name category.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM finance.loans GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me account_id, last_active, last_name for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, last_active, last_name FROM finance.loans;", "sql": null}, {"role": "user", "content": "Find loans from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, last_active, last_name FROM finance.loans WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of loans in each full_name category.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM finance.loans GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by bio descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY bio DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY bio DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_login date NOT NULL,\n username varchar NOT NULL,\n bio text,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.loans (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n full_name char,\n last_name character varying(256) NOT NULL,\n first_name character varying(128),\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status char,\n vendor_id character varying(256) NOT NULL,\n customer_id character varying(128),\n user_id character varying(128),\n invoice_number character varying(128) NOT NULL,\n loan_id text -- reference to loans.employee_id,\n FOREIGN KEY (loan_id) REFERENCES loans(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Get first_name, last_name, customer_id, vendor_id by joining loans with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.customer_id, accounts.vendor_id FROM finance.loans JOIN finance.accounts ON loans.account_id = accounts.invoice_id;", "sql": null}, {"role": "user", "content": "Show me the count of loans grouped by first_name.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM finance.loans GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "What are the salt, last_login, gender of each course?", "sql": null}, {"role": "assistant", "content": "SELECT salt, last_login, gender FROM education.courses;", "sql": null}, {"role": "user", "content": "Arrange the results with account_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT salt, last_login, gender FROM education.courses ORDER BY account_status DESC;", "sql": null}, {"role": "user", "content": "Sort the results by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT salt, last_login, gender FROM education.courses ORDER BY display_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "What account_status, salt, membership_level, token do we have for courses and their associated students?", "sql": null}, {"role": "assistant", "content": "SELECT *, students.membership_level, students.token FROM education.courses JOIN education.students ON courses.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Show me the count of courses grouped by display_name.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.courses GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get invoice_id, invoice_number, membership_level, token by joining assignments with students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.membership_level, students.token FROM education.assignments JOIN education.students ON assignments.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Show me the count of assignments grouped by student_id.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.assignments GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments that have reconciliation_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE reconciliation_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of amount by processed_at from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MIN(amount) AS min_amount FROM education.assignments GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "List salt, created_at, membership_level, email for each course along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.membership_level, students.email FROM education.courses JOIN education.students ON courses.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Get the distribution of courses across different account_status values.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, COUNT(*) AS count FROM education.courses GROUP BY account_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Show me invoice_number, notes, processed_at for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, notes, processed_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where notes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, notes, processed_at FROM education.assignments WHERE notes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with invoice_number in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, notes, processed_at FROM education.assignments WHERE notes LIKE 'A%' ORDER BY invoice_number DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Show me display_name, student_id, salt for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, student_id, salt FROM education.courses;", "sql": null}, {"role": "user", "content": "List last_active, created_at, last_login, token for each course along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, student_id, salt, students.last_login, students.token FROM education.courses JOIN education.students ON courses.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Get the distribution of courses across different display_name values.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.courses GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many assignments are there per student_id?", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.assignments GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "What are the student_id, reconciliation_status, category of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT student_id, reconciliation_status, category FROM education.assignments;", "sql": null}, {"role": "user", "content": "Arrange the results with category in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, reconciliation_status, category FROM education.assignments ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Get average of student_id by invoice_number from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, AVERAGE(student_id) AS average_student_id FROM education.assignments GROUP BY invoice_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n account_status character varying(256) NOT NULL,\n display_name varchar,\n salt text NOT NULL,\n last_login timestamp,\n gender char,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n timezone character varying(64),\n email character varying(64) NOT NULL,\n membership_level character varying(64) NOT NULL,\n city varchar,\n token char,\n first_name character varying(128),\n last_login timestamp\n)\n\nCREATE TABLE education.assignments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n notes character varying(128),\n category text,\n reconciliation_status char,\n amount decimal,\n invoice_number char NOT NULL,\n student_id integer -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "What are the salt, display_name, last_active of each course?", "sql": null}, {"role": "assistant", "content": "SELECT salt, display_name, last_active FROM education.courses;", "sql": null}, {"role": "user", "content": "Show the results sorted by salt ascending.", "sql": null}, {"role": "assistant", "content": "SELECT salt, display_name, last_active FROM education.courses ORDER BY salt ASC;", "sql": null}, {"role": "user", "content": "What is the max account_status for each last_login in courses?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, MAX(account_status) AS max_account_status FROM education.courses GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, popularity_score, sale_id for every product.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, sale_id FROM media.products;", "sql": null}, {"role": "user", "content": "List products with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, popularity_score, sale_id FROM media.products WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many products are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM media.products GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me membership_level, last_active, gender for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, last_active, gender FROM media.patients;", "sql": null}, {"role": "user", "content": "Get patients that match bio LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, last_active, gender FROM media.patients WHERE bio LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by display_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, last_active, gender FROM media.patients WHERE bio LIKE 'A%' ORDER BY display_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.sales;", "sql": null}, {"role": "user", "content": "Retrieve sales where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.sales WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by currency ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.sales WHERE approval_status LIKE 'A%' ORDER BY currency ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "List bio, updated_at, membership_level from patients.", "sql": null}, {"role": "assistant", "content": "SELECT bio, updated_at, membership_level FROM media.patients;", "sql": null}, {"role": "user", "content": "Find patients from last week.", "sql": null}, {"role": "assistant", "content": "SELECT bio, updated_at, membership_level FROM media.patients WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by gender ascending.", "sql": null}, {"role": "assistant", "content": "SELECT bio, updated_at, membership_level FROM media.patients WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' ORDER BY gender ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.patients;", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.patients ORDER BY product_id DESC;", "sql": null}, {"role": "user", "content": "Show me max of membership_level grouped by display_name for patients.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, MAX(membership_level) AS max_membership_level FROM media.patients GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.sales;", "sql": null}, {"role": "user", "content": "List subtotal, product_id, currency, brand for each sale along with their product information.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.currency, products.brand FROM media.sales JOIN media.products ON sales.product_id = products.item_id;", "sql": null}, {"role": "user", "content": "Tally up sales by product_id.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM media.sales GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "List updated_at, sale_id, popularity_score from products.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, sale_id, popularity_score FROM media.products;", "sql": null}, {"role": "user", "content": "Find products older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, sale_id, popularity_score FROM media.products WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, sale_id, popularity_score FROM media.products WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "List popularity_score, sale_id, updated_at from products.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, sale_id, updated_at FROM media.products;", "sql": null}, {"role": "user", "content": "What brand, updated_at, approval_status, currency do we have for products and their associated sales?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, sale_id, updated_at, sales.approval_status, sales.currency FROM media.products JOIN media.sales ON products.sale_id = sales.invoice_id;", "sql": null}, {"role": "user", "content": "Get the distribution of products across different sale_id values.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, COUNT(*) AS count FROM media.products GROUP BY sale_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.sales;", "sql": null}, {"role": "user", "content": "List currency, user_id, updated_at, brand for each sale along with their product information.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.updated_at, products.brand FROM media.sales JOIN media.products ON sales.product_id = products.item_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.updated_at, products.brand FROM media.sales JOIN media.products ON sales.product_id = products.item_id ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.sales (\n invoice_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n user_id text NOT NULL -- identifier for user,\n buyer_id char,\n subtotal bigint,\n currency text,\n approval_status char,\n customer_id character varying(64),\n product_id text NOT NULL -- reference to products.item_id,\n patient_id integer -- reference to patients.employee_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id),\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE media.patients (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n updated_at date,\n bio varchar NOT NULL,\n membership_level char,\n display_name text,\n gender character varying(256),\n sale_id integer NOT NULL -- reference to sales.invoice_id,\n product_id text -- reference to products.item_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id),\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)\n\nCREATE TABLE media.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n popularity_score varchar NOT NULL,\n currency character varying(128),\n brand varchar,\n sale_id integer -- reference to sales.invoice_id,\n FOREIGN KEY (sale_id) REFERENCES sales(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me sale_id, bio, updated_at for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, bio, updated_at FROM media.patients;", "sql": null}, {"role": "user", "content": "Get updated_at, last_active, approval_status, subtotal by joining patients with sales.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, bio, updated_at, sales.approval_status, sales.subtotal FROM media.patients JOIN media.sales ON patients.sale_id = sales.invoice_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, bio, updated_at, sales.approval_status, sales.subtotal FROM media.patients JOIN media.sales ON patients.sale_id = sales.invoice_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "What are the description, published_at, subject of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT description, published_at, subject FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT description, published_at, subject FROM socialmedia.comments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with description in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT description, published_at, subject FROM socialmedia.comments WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many posts are there per subject?", "sql": null}, {"role": "assistant", "content": "SELECT subject, COUNT(*) AS count FROM socialmedia.posts GROUP BY subject ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Show me published_at, thumbnail, created_at for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, created_at FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments that have thumbnail LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, created_at FROM socialmedia.comments WHERE thumbnail LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, thumbnail, created_at FROM socialmedia.comments WHERE thumbnail LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, created_at, visibility for every post.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, visibility FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, visibility FROM socialmedia.posts WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by subject ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, visibility FROM socialmedia.posts WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY subject ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "What created_at, description, comment_id, updated_at do we have for comments and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.comment_id, posts.updated_at FROM socialmedia.comments JOIN socialmedia.posts ON comments.post_id = posts.id;", "sql": null}, {"role": "user", "content": "Count the number of comments in each thumbnail category.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, COUNT(*) AS count FROM socialmedia.comments GROUP BY thumbnail ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of posts in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.posts GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of description for each thumbnail in comments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, AVERAGE(description) AS average_description FROM socialmedia.comments GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get posts that match image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of posts across different categories values.", "sql": null}, {"role": "assistant", "content": "SELECT categories, COUNT(*) AS count FROM socialmedia.posts GROUP BY categories ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Sort the results by reply_to_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY reply_to_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY reply_to_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n author_id varchar NOT NULL,\n description text,\n subject varchar NOT NULL,\n thumbnail character varying(128),\n format character varying(64),\n reply_to_id char,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n visibility varchar,\n rating character varying(128),\n image_url character varying(64),\n categories character varying(256) NOT NULL,\n subject character varying(128),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)", "conversations": [{"role": "user", "content": "What are the subject, reply_to_id, post_id of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT subject, reply_to_id, post_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get comments that match format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subject, reply_to_id, post_id FROM socialmedia.comments WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of subject by post_id from comments.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, SUM(subject) AS sum_subject FROM socialmedia.comments GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n credit character varying(256) NOT NULL,\n reference_number text,\n status character varying(128),\n vendor_id character varying(128) NOT NULL,\n debit character varying(128),\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n completed_at timestamp without time zone,\n approval_status character varying(64) NOT NULL,\n status text,\n subtotal decimal NOT NULL,\n payment_method text NOT NULL,\n enrollment_id text NOT NULL -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.assignments (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number char,\n status character varying(256) NOT NULL,\n payer_id text,\n approval_status character varying(64),\n balance integer,\n exchange_rate text,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n categories character varying(64) NOT NULL,\n image_url character varying(256) NOT NULL,\n author_id varchar NOT NULL,\n visibility text,\n title char NOT NULL,\n content varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show the results sorted by reference_number descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY reference_number DESC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY reference_number DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n credit character varying(256) NOT NULL,\n reference_number text,\n status character varying(128),\n vendor_id character varying(128) NOT NULL,\n debit character varying(128),\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n completed_at timestamp without time zone,\n approval_status character varying(64) NOT NULL,\n status text,\n subtotal decimal NOT NULL,\n payment_method text NOT NULL,\n enrollment_id text NOT NULL -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.assignments (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number char,\n status character varying(256) NOT NULL,\n payer_id text,\n approval_status character varying(64),\n balance integer,\n exchange_rate text,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n categories character varying(64) NOT NULL,\n image_url character varying(256) NOT NULL,\n author_id varchar NOT NULL,\n visibility text,\n title char NOT NULL,\n content varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Can you order these by debit ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY debit ASC;", "sql": null}, {"role": "user", "content": "Sort the results by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY transaction_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n payment_date timestamp,\n credit character varying(256) NOT NULL,\n reference_number text,\n status character varying(128),\n vendor_id character varying(128) NOT NULL,\n debit character varying(128),\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n completed_at timestamp without time zone,\n approval_status character varying(64) NOT NULL,\n status text,\n subtotal decimal NOT NULL,\n payment_method text NOT NULL,\n enrollment_id text NOT NULL -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.assignments (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number char,\n status character varying(256) NOT NULL,\n payer_id text,\n approval_status character varying(64),\n balance integer,\n exchange_rate text,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)\n\nCREATE TABLE education.enrollments (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n categories character varying(64) NOT NULL,\n image_url character varying(256) NOT NULL,\n author_id varchar NOT NULL,\n visibility text,\n title char NOT NULL,\n content varchar\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show the results sorted by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by enrollment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY enrollment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Order the output by traded_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY traded_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE traded_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many enrollments are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM education.enrollments GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments that have traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE traded_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, completed_at, amount for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, completed_at, amount FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, completed_at, amount FROM education.enrollments WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of customer_id by course_id from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, MIN(customer_id) AS min_customer_id FROM education.enrollments GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Get transaction_id, course_id, currency from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, course_id, currency FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by traded_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, course_id, currency FROM education.enrollments ORDER BY traded_at DESC;", "sql": null}, {"role": "user", "content": "Calculate min of currency for each course_id in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, MIN(currency) AS min_currency FROM education.enrollments GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve course_id, amount, completed_at for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, amount, completed_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, amount, completed_at FROM education.enrollments WHERE traded_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me max of currency grouped by amount for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT amount, MAX(currency) AS max_currency FROM education.enrollments GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Show me traded_at, completed_at, customer_id for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, customer_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, customer_id FROM education.enrollments WHERE traded_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of customer_id for each completed_at in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, MIN(customer_id) AS min_customer_id FROM education.enrollments GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Get traded_at, completed_at, currency from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, currency FROM education.enrollments;", "sql": null}, {"role": "user", "content": "What course_id, currency, quantity, expires_at do we have for enrollments and their associated courses?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, currency, courses.quantity, courses.expires_at FROM education.enrollments JOIN education.courses ON enrollments.course_id = courses.product_id;", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by amount.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM education.enrollments GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n description character varying(256),\n popularity_score character varying(128),\n quantity character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n completed_at date,\n traded_at date,\n customer_id varchar -- identifier for customer,\n amount bigint,\n currency character varying(64),\n course_id text NOT NULL -- reference to courses.product_id,\n FOREIGN KEY (course_id) REFERENCES courses(product_id)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, amount, completed_at for all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, amount, completed_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, amount, completed_at FROM education.enrollments WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, amount, completed_at FROM education.enrollments WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Get category, price, created_at from all courses.", "sql": null}, {"role": "assistant", "content": "SELECT category, price, created_at FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses where thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, price, created_at FROM education.courses WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of price for each price in courses.", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(price) AS count_price FROM education.courses GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "List created_at, image_url, price from courses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, price FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses where assignment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, image_url, price FROM education.courses WHERE assignment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many courses are there per featured_rank?", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM education.courses GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve quantity, course_id, assignment_id, image_url showing the relationship between assignments and courses.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.assignment_id, courses.image_url FROM education.assignments JOIN education.courses ON assignments.course_id = courses.sku;", "sql": null}, {"role": "user", "content": "Show me sum of traded_at grouped by seller_id for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, SUM(traded_at) AS sum_traded_at FROM education.assignments GROUP BY seller_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "List created_at, delivery_status, seller_id from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, delivery_status, seller_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, delivery_status, seller_id FROM education.assignments WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, delivery_status, seller_id FROM education.assignments WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "List updated_at, image_url, assignment_id from courses.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, image_url, assignment_id FROM education.courses;", "sql": null}, {"role": "user", "content": "List courses that have thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, image_url, assignment_id FROM education.courses WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum category for each updated_at in courses?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(category) AS sum_category FROM education.courses GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Show the results sorted by image_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY image_url ASC;", "sql": null}, {"role": "user", "content": "Show me the count of courses grouped by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM education.courses GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match traded_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE traded_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the min traded_at for each created_at in assignments?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(traded_at) AS min_traded_at FROM education.assignments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by course_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY course_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY course_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "What are the debit, category, payment_id of each department?", "sql": null}, {"role": "assistant", "content": "SELECT debit, category, payment_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT debit, category, payment_id FROM education.departments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of departments in each verification_status category.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM education.departments GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n credit character varying(256),\n debit varchar NOT NULL,\n verification_status char,\n category character varying(128) NOT NULL,\n reconciliation_status char,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.courses (\n sku text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n rating character varying(128),\n featured_rank varchar,\n image_url varchar,\n price decimal,\n thumbnail_url text NOT NULL,\n category char NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.transaction_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(transaction_id)\n)\n\nCREATE TABLE education.assignments (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at timestamp without time zone,\n delivery_status character varying(128),\n quantity varchar,\n seller_id character varying(64) -- identifier for seller,\n course_id text NOT NULL -- reference to courses.sku,\n FOREIGN KEY (course_id) REFERENCES courses(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, seller_id, quantity for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, seller_id, quantity FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, seller_id, quantity FROM education.assignments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me max of quantity grouped by course_id for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, MAX(quantity) AS max_quantity FROM education.assignments GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Can you order these by payment_method ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.purchases ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.purchases ORDER BY payment_method ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me debit, category, payee_id for all finances.", "sql": null}, {"role": "assistant", "content": "SELECT debit, category, payee_id FROM restaurant.finances;", "sql": null}, {"role": "user", "content": "Show me finances that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT debit, category, payee_id FROM restaurant.finances WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT debit, category, payee_id FROM restaurant.finances WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "List delivery_status, exchange_rate, payment_method from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, exchange_rate, payment_method FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Arrange the results with price in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, exchange_rate, payment_method FROM restaurant.purchases ORDER BY price ASC;", "sql": null}, {"role": "user", "content": "Show me the count of purchases grouped by payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM restaurant.purchases GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve finance_id, price, payment_method for every purchase.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, price, payment_method FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "List purchases that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, price, payment_method FROM restaurant.purchases WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_method in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, price, payment_method FROM restaurant.purchases WHERE payment_method LIKE 'A%' ORDER BY payment_method DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Get all purchases modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.purchases WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the min completed_at for each exchange_rate in purchases?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, MIN(completed_at) AS min_completed_at FROM restaurant.purchases GROUP BY exchange_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "List finance_id, price, completed_at from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, price, completed_at FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, price, completed_at FROM restaurant.purchases ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "How many purchases are there per payment_method?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM restaurant.purchases GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "List all finances.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.finances;", "sql": null}, {"role": "user", "content": "What debit, invoice_number, finance_id, delivery_status do we have for finances and their associated purchases?", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.finance_id, purchases.delivery_status FROM restaurant.finances JOIN restaurant.purchases ON finances.purchase_id = purchases.id;", "sql": null}, {"role": "user", "content": "How many finances are there per invoice_number?", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, COUNT(*) AS count FROM restaurant.finances GROUP BY invoice_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me payment_method, price, completed_at for all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, completed_at FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Get payment_method, delivery_status, description, payee_id by joining purchases with finances.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, completed_at, finances.description, finances.payee_id FROM restaurant.purchases JOIN restaurant.finances ON purchases.finance_id = finances.payment_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by finance_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, price, completed_at, finances.description, finances.payee_id FROM restaurant.purchases JOIN restaurant.finances ON purchases.finance_id = finances.payment_id ORDER BY finance_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "List price, exchange_rate, approval_status from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT price, exchange_rate, approval_status FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Get purchases that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT price, exchange_rate, approval_status FROM restaurant.purchases WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max exchange_rate for each price in purchases?", "sql": null}, {"role": "assistant", "content": "SELECT price, MAX(exchange_rate) AS max_exchange_rate FROM restaurant.purchases GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.finances (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n category character varying(256),\n payee_id char NOT NULL -- identifier for payee,\n invoice_number character varying(256),\n description char,\n debit character varying(128),\n purchase_id text NOT NULL -- reference to purchases.id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(id)\n)\n\nCREATE TABLE restaurant.purchases (\n id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n delivery_status char,\n price decimal NOT NULL,\n approval_status char NOT NULL,\n exchange_rate char,\n payment_method text NOT NULL,\n finance_id text -- reference to finances.payment_id,\n FOREIGN KEY (finance_id) REFERENCES finances(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve delivery_status, completed_at, payment_method for every purchase.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, completed_at, payment_method FROM restaurant.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, completed_at, payment_method FROM restaurant.purchases WHERE completed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, completed_at, payment_method FROM restaurant.purchases WHERE completed_at > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "List quantity, cancelled_at, discount from sales.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, cancelled_at, discount FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Can you order these by processed_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT quantity, cancelled_at, discount FROM logistics.sales ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, cancelled_at, discount FROM logistics.sales ORDER BY processed_at ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Display all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.stores;", "sql": null}, {"role": "user", "content": "Show me coordinates, postal_code, payment_status, discount from stores and their related sales.", "sql": null}, {"role": "assistant", "content": "SELECT *, sales.payment_status, sales.discount FROM logistics.stores JOIN logistics.sales ON stores.sale_id = sales.id;", "sql": null}, {"role": "user", "content": "Calculate min of address_line1 for each postal_code in stores.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, MIN(address_line1) AS min_address_line1 FROM logistics.stores GROUP BY postal_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.stores;", "sql": null}, {"role": "user", "content": "Show me stores with address_line1 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.stores WHERE address_line1 LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many stores are there per country?", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM logistics.stores GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Get all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Show me sales that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "List all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Get sales that match discount > 76.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales WHERE discount > 76;", "sql": null}, {"role": "user", "content": "Get max of processed_at by store_id from sales.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, MAX(processed_at) AS max_processed_at FROM logistics.sales GROUP BY store_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Get all sales.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Get all sales modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.sales WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get sum of payment_status by payment_status from sales.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, SUM(payment_status) AS sum_payment_status FROM logistics.sales GROUP BY payment_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Retrieve quantity, store_id, payment_status for every sale.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, store_id, payment_status FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Get sales that match discount > 18.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, store_id, payment_status FROM logistics.sales WHERE discount > 18;", "sql": null}, {"role": "user", "content": "Get the distribution of sales across different quantity values.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM logistics.sales GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "Get all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.stores;", "sql": null}, {"role": "user", "content": "Get stores that match geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.stores WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group stores by city and show the max of address_line1.", "sql": null}, {"role": "assistant", "content": "SELECT city, MAX(address_line1) AS max_address_line1 FROM logistics.stores GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "List discount, store_id, processed_at from sales.", "sql": null}, {"role": "assistant", "content": "SELECT discount, store_id, processed_at FROM logistics.sales;", "sql": null}, {"role": "user", "content": "Find sales created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT discount, store_id, processed_at FROM logistics.sales WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT discount, store_id, processed_at FROM logistics.sales WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.sales (\n id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp,\n discount numeric(38,14),\n quantity character varying(64),\n payment_status character varying(128) NOT NULL,\n store_id integer -- reference to stores.address_id,\n FOREIGN KEY (store_id) REFERENCES stores(address_id)\n)\n\nCREATE TABLE logistics.stores (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n address_line1 character varying(256) NOT NULL,\n postal_code char,\n geo_point character varying(64),\n coordinates character varying(256),\n description varchar NOT NULL,\n country char NOT NULL,\n city char,\n sale_id integer -- reference to sales.id,\n FOREIGN KEY (sale_id) REFERENCES sales(id)\n)\n\nCREATE TABLE logistics.comments (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n body character varying(128),\n image_url text,\n user_id character varying(256) NOT NULL,\n attachment_url text,\n text varchar\n)", "conversations": [{"role": "user", "content": "List city, description, country from stores.", "sql": null}, {"role": "assistant", "content": "SELECT city, description, country FROM logistics.stores;", "sql": null}, {"role": "user", "content": "Show me stores with coordinates LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT city, description, country FROM logistics.stores WHERE coordinates LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of postal_code grouped by sale_id for stores.", "sql": null}, {"role": "assistant", "content": "SELECT sale_id, SUM(postal_code) AS sum_postal_code FROM logistics.stores GROUP BY sale_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by state descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE transaction_id LIKE 'A%' ORDER BY state DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Can you order these by approval_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Get sum of processed_at by investment_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, SUM(processed_at) AS sum_processed_at FROM finance.transactions GROUP BY investment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "Retrieve country, website, last_active for every investment.", "sql": null}, {"role": "assistant", "content": "SELECT country, website, last_active FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT country, website, last_active FROM finance.investments ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with state in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT country, website, last_active FROM finance.investments ORDER BY state DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "What are the transaction_id, country, website of each investment?", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, country, website FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show me investments with last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, country, website FROM finance.investments WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, country, website FROM finance.investments WHERE last_active > '2023-01-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_status character varying(64),\n exchange_rate char NOT NULL,\n approval_status character varying(128),\n card_type varchar,\n account_id text NOT NULL -- reference to accounts.transaction_id,\n investment_id integer NOT NULL -- reference to investments.person_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (investment_id) REFERENCES investments(person_id)\n)\n\nCREATE TABLE finance.investments (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n state text NOT NULL,\n website text,\n country char,\n transaction_id text -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n status character varying(256),\n subtotal decimal,\n price numeric(38,14)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n currency character varying(128),\n description text,\n debit char,\n customer_id character varying(64) -- identifier for customer,\n verification_status varchar,\n category varchar\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Arrange the results with transaction_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY transaction_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of investments across different website values.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(*) AS count FROM finance.investments GROUP BY website ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "List customer_id, accessibility, location_id from locations.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, accessibility, location_id FROM events.locations;", "sql": null}, {"role": "user", "content": "Show me parking_available, customer_id, status, email from locations and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, accessibility, location_id, customers.status, customers.email FROM events.locations JOIN events.customers ON locations.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different longitude values.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(*) AS count FROM events.locations GROUP BY longitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Get created_at, location_id, parking_available from all locations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_id, parking_available FROM events.locations;", "sql": null}, {"role": "user", "content": "List longitude, coordinates, account_status, email for each location along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_id, parking_available, customers.account_status, customers.email FROM events.locations JOIN events.customers ON locations.customer_id = customers.user_id;", "sql": null}, {"role": "user", "content": "Group locations by location_id and show the average of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, AVERAGE(created_at) AS average_created_at FROM events.locations GROUP BY location_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "List locations with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get the distribution of locations across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM events.locations GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "Sort the results by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations ORDER BY accessibility ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations ORDER BY accessibility ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Retrieve all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where location_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE location_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by longitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE location_id LIKE 'A%' ORDER BY longitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "What are the created_at, customer_id, parking_available of each location?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, parking_available FROM events.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where customer_id > 28.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, customer_id, parking_available FROM events.locations WHERE customer_id > 28;", "sql": null}, {"role": "user", "content": "Group locations by created_at and show the count of parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(parking_available) AS count_parking_available FROM events.locations GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "Retrieve locations where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with customer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Get created_at, coordinates, longitude from all locations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, coordinates, longitude FROM events.locations;", "sql": null}, {"role": "user", "content": "Show me locations with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, coordinates, longitude FROM events.locations WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, coordinates, longitude FROM events.locations WHERE created_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Show me all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "Show me locations with accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE accessibility LIKE 'A%' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.locations (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n parking_available text NOT NULL,\n coordinates char NOT NULL,\n accessibility character varying(64),\n longitude text,\n customer_id integer NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE events.customers (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n website text,\n status text,\n zip_code character varying(256),\n birth_date timestamp,\n email varchar,\n account_status character varying(128)\n)\n\nCREATE TABLE events.articles (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n description text NOT NULL,\n reply_to_id char NOT NULL -- identifier for reply_to,\n thumbnail char\n)", "conversations": [{"role": "user", "content": "Display all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations;", "sql": null}, {"role": "user", "content": "Show me locations with coordinates LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.locations WHERE coordinates LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of locations in each location_id category.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, COUNT(*) AS count FROM events.locations GROUP BY location_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What verification_status, exchange_rate, bio, membership_level do we have for accounts and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.bio, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Arrange the results with description in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.bio, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.employee_id ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Get name, state, customer_id from all investments.", "sql": null}, {"role": "assistant", "content": "SELECT name, state, customer_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT name, state, customer_id FROM finance.investments ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT name, state, customer_id FROM finance.investments ORDER BY updated_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show me investments with state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get min of last_inspected by name from investments.", "sql": null}, {"role": "assistant", "content": "SELECT name, MIN(last_inspected) AS min_last_inspected FROM finance.investments GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by account_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE due_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY account_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve investments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many investments are there per state?", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM finance.investments GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Order the output by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments ORDER BY updated_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "What are the exchange_rate, verification_status, updated_at of each account?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, verification_status, updated_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with description in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, verification_status, updated_at FROM finance.accounts ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Count the number of accounts in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM finance.accounts GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve operating_hours, updated_at, customer_id for every investment.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, updated_at, customer_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show the results sorted by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, updated_at, customer_id FROM finance.investments ORDER BY name ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, updated_at, customer_id FROM finance.investments ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Get account_id, due_date, updated_at from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, due_date, updated_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get updated_at, customer_id, last_active, membership_level by joining accounts with customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, due_date, updated_at, customers.last_active, customers.membership_level FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Show me the count of accounts grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM finance.accounts GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp,\n membership_level varchar,\n bio character varying(256) NOT NULL,\n last_name character varying(64)\n)\n\nCREATE TABLE finance.accounts (\n account_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n updated_at timestamp,\n description text,\n exchange_rate text NOT NULL,\n user_id character varying(128) -- identifier for user,\n credit varchar,\n verification_status character varying(64),\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n name text,\n operating_hours text,\n description character varying(128),\n state text,\n customer_id text -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me description, state, updated_at for all investments.", "sql": null}, {"role": "assistant", "content": "SELECT description, state, updated_at FROM finance.investments;", "sql": null}, {"role": "user", "content": "List name, description, last_name, updated_at for each investment along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT description, state, updated_at, customers.last_name, customers.updated_at FROM finance.investments JOIN finance.customers ON investments.customer_id = customers.employee_id;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT description, state, updated_at, customers.last_name, customers.updated_at FROM finance.investments JOIN finance.customers ON investments.customer_id = customers.employee_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List students that have api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of is_active by language from students.", "sql": null}, {"role": "assistant", "content": "SELECT language, SUM(is_active) AS sum_is_active FROM education.students GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List user_id, tags, author_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, tags, author_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Order the output by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, tags, author_id FROM education.departments ORDER BY author_id DESC;", "sql": null}, {"role": "user", "content": "Order the output by thumbnail ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, tags, author_id FROM education.departments ORDER BY thumbnail ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the language, website, employee_id of each student?", "sql": null}, {"role": "assistant", "content": "SELECT language, website, employee_id FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT language, website, employee_id FROM education.students ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "How many students are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.students GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me edited_at, description, message_id for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, description, message_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Get all departments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, description, message_id FROM education.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with tags in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, description, message_id FROM education.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY tags DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Arrange the results with api_key in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY api_key ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with employee_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY employee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Get sum of employee_id by created_at from students.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(employee_id) AS sum_employee_id FROM education.students GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where age LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE age LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE age LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get created_at, address, language from all students.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, address, language FROM education.students;", "sql": null}, {"role": "user", "content": "Find students from last week.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, address, language FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with is_active in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, address, language FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY is_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List api_key, age, language from students.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, language FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where age LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, language FROM education.students WHERE age LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, age, language FROM education.students WHERE age LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n api_key character varying(64),\n website character varying(128) NOT NULL,\n age character varying(256),\n language varchar,\n address char,\n is_active bit NOT NULL\n)\n\nCREATE TABLE education.departments (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n edited_at date,\n thumbnail text NOT NULL,\n user_id text,\n author_id character varying(128) -- identifier for author,\n tags char,\n description character varying(64),\n text varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List description, author_id, user_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT description, author_id, user_id FROM education.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, author_id, user_id FROM education.departments ORDER BY description DESC;", "sql": null}, {"role": "user", "content": "Calculate max of user_id for each updated_at in departments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(user_id) AS max_user_id FROM education.departments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n account_id character varying(256),\n fee character varying(256),\n card_type character varying(128),\n delivery_status character varying(128) NOT NULL,\n payment_method character varying(256),\n customer_id character varying(64) -- identifier for customer\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at timestamp,\n is_active bit -- indicates if active is true,\n account_status character varying(64),\n status character varying(128),\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n transaction_id integer NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n total numeric,\n user_id character varying(256),\n account_id char -- identifier for account,\n card_type char,\n product_id char NOT NULL -- identifier for product,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by product_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at > '2023-01-01' ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n account_id character varying(256),\n fee character varying(256),\n card_type character varying(128),\n delivery_status character varying(128) NOT NULL,\n payment_method character varying(256),\n customer_id character varying(64) -- identifier for customer\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at timestamp,\n is_active bit -- indicates if active is true,\n account_status character varying(64),\n status character varying(128),\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n transaction_id integer NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n total numeric,\n user_id character varying(256),\n account_id char -- identifier for account,\n card_type char,\n product_id char NOT NULL -- identifier for product,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get min of product_id by product_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, MIN(product_id) AS min_product_id FROM finance.payments GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n account_id character varying(256),\n fee character varying(256),\n card_type character varying(128),\n delivery_status character varying(128) NOT NULL,\n payment_method character varying(256),\n customer_id character varying(64) -- identifier for customer\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at timestamp,\n is_active bit -- indicates if active is true,\n account_status character varying(64),\n status character varying(128),\n is_verified bit NOT NULL -- indicates if verified is true,\n profile_picture_url character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n transaction_id integer NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id),\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp without time zone,\n total numeric,\n user_id character varying(256),\n account_id char -- identifier for account,\n card_type char,\n product_id char NOT NULL -- identifier for product,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE account_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Show me all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits that have payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE payment_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Retrieve amount, cancelled_at, payment_id for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, payment_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions with processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, payment_id FROM finance.transactions WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, payment_id FROM finance.transactions WHERE processed_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "What are the payment_id, customer_id, payment_method of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, customer_id, payment_method FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get account_id, payment_method, traded_at, audit_id by joining audits with payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, customer_id, payment_method, payments.traded_at, payments.audit_id FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, customer_id, payment_method, payments.traded_at, payments.audit_id FROM finance.audits JOIN finance.payments ON audits.payment_id = payments.transaction_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get processed_at, payment_id, traded_at, quantity by joining transactions with payments.", "sql": null}, {"role": "assistant", "content": "SELECT *, payments.traded_at, payments.quantity FROM finance.transactions JOIN finance.payments ON transactions.payment_id = payments.transaction_id;", "sql": null}, {"role": "user", "content": "Get average of payment_id by cancelled_at from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, AVERAGE(payment_id) AS average_payment_id FROM finance.transactions GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with amount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at > '2023-12-01' ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "What are the payment_status, payment_id, cancelled_at of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, payment_id, cancelled_at FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, payment_id, cancelled_at FROM finance.transactions ORDER BY payment_status ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, payment_id, cancelled_at FROM finance.transactions ORDER BY payment_status ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Retrieve amount, cancelled_at, processed_at for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, processed_at FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, processed_at FROM finance.transactions WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT amount, cancelled_at, processed_at FROM finance.transactions WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY approval_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get transactions that match amount > 35.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE amount > 35;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE amount > 35 LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n cancelled_at timestamp without time zone,\n payment_status char,\n amount bigint NOT NULL,\n approval_status character varying(64),\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n account_id text,\n subtotal numeric,\n card_type text NOT NULL,\n customer_id char,\n payment_method character varying(64),\n product_id character varying(256) NOT NULL,\n payment_id text NOT NULL -- reference to payments.transaction_id,\n FOREIGN KEY (payment_id) REFERENCES payments(transaction_id)\n)\n\nCREATE TABLE finance.payments (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n traded_at date,\n payment_method character varying(64),\n quantity text,\n payment_status character varying(64),\n tax numeric(38,14) NOT NULL,\n audit_id text -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up transactions by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.transactions GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get msrp, created_at, thumbnail, created_at by joining products with shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.thumbnail, shipping.created_at FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.thumbnail, shipping.created_at FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve barcode, created_at, likes, body showing the relationship between products and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.likes, shipping.body FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.likes, shipping.body FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me msrp, stock_level, likes, visibility from products and their related shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.likes, shipping.visibility FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id;", "sql": null}, {"role": "user", "content": "Group products by stock_level and show the sum of stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, SUM(stock_level) AS sum_stock_level FROM e-commerce.products GROUP BY stock_level;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get subcategory, video_url, shippin_id from all products.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, video_url, shippin_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have barcode LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, video_url, shippin_id FROM e-commerce.products WHERE barcode LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get sum of barcode by barcode from products.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, SUM(barcode) AS sum_barcode FROM e-commerce.products GROUP BY barcode;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of products in each stock_level category.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, COUNT(*) AS count FROM e-commerce.products GROUP BY stock_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve shippin_id, barcode, created_at for every product.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, barcode, created_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, barcode, created_at FROM e-commerce.products WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with barcode in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, barcode, created_at FROM e-commerce.products WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY barcode ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the created_at, msrp, barcode of each product?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, msrp, barcode FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by shippin_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, msrp, barcode FROM e-commerce.products ORDER BY shippin_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by subcategory descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, msrp, barcode FROM e-commerce.products ORDER BY subcategory DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the barcode, shippin_id, video_url of each product?", "sql": null}, {"role": "assistant", "content": "SELECT barcode, shippin_id, video_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List barcode, subcategory, likes, reply_to_id for each product along with their shipping information.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, shippin_id, video_url, shipping.likes, shipping.reply_to_id FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.content_id;", "sql": null}, {"role": "user", "content": "Get the distribution of products across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.products GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the stock_level, shippin_id, video_url of each product?", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, shippin_id, video_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have subcategory LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, shippin_id, video_url FROM e-commerce.products WHERE subcategory LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, shippin_id, video_url FROM e-commerce.products WHERE subcategory LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n created_at date,\n video_url character varying(128),\n subcategory character varying(128),\n stock_level character varying(256),\n msrp character varying(256),\n shippin_id integer NOT NULL -- reference to shipping.content_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(content_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n likes char,\n format character varying(256),\n reply_to_id character varying(256) -- identifier for reply_to,\n body char,\n visibility character varying(64),\n thumbnail character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me msrp, created_at, shippin_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, created_at, shippin_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, created_at, shippin_id FROM e-commerce.products WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me sum of created_at grouped by barcode for products.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, SUM(created_at) AS sum_created_at FROM e-commerce.products GROUP BY barcode;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get customer_id, processed_at, full_name, birth_date by joining prescriptions with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.full_name, patients.birth_date FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.full_name, patients.birth_date FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "List all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List prescriptions with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE processed_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the user_id, status, patient_id of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, status, patient_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, status, patient_id FROM healthcare.prescriptions WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, status, patient_id FROM healthcare.prescriptions WHERE processed_at > '2023-12-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of patient_id for each verification_status in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, MAX(patient_id) AS max_patient_id FROM healthcare.prescriptions GROUP BY verification_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "What status, user_id, website, full_name do we have for prescriptions and their associated patients?", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.website, patients.full_name FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Can you order these by invoice_number ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.website, patients.full_name FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id ORDER BY invoice_number ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show me max of processed_at grouped by status for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT status, MAX(processed_at) AS max_processed_at FROM healthcare.prescriptions GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Get patient_id, user_id, customer_id from all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, user_id, customer_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match verification_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, user_id, customer_id FROM healthcare.prescriptions WHERE verification_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by processed_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, user_id, customer_id FROM healthcare.prescriptions WHERE verification_status LIKE 'A%' ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Get verification_status, invoice_number, vendor_id from all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, vendor_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve processed_at, user_id, birth_date, full_name showing the relationship between prescriptions and patients.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, vendor_id, patients.birth_date, patients.full_name FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, invoice_number, vendor_id, patients.birth_date, patients.full_name FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, processed_at, website, address showing the relationship between prescriptions and patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.website, patients.address FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Calculate max of user_id for each status in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT status, MAX(user_id) AS max_user_id FROM healthcare.prescriptions GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n user_id character varying(256),\n status character varying(128),\n verification_status varchar,\n customer_id varchar,\n vendor_id character varying(128),\n invoice_number character varying(256) NOT NULL,\n patient_id text NOT NULL -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n full_name char NOT NULL,\n birth_date date,\n website char,\n address character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the customer_id, processed_at, patient_id of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, processed_at, patient_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Sort the results by vendor_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, processed_at, patient_id FROM healthcare.prescriptions ORDER BY vendor_id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Show me location_lon, user_id, username, password_hash from venues and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.username, users.password_hash FROM travel.venues JOIN travel.users ON venues.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Order the output by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.username, users.password_hash FROM travel.venues JOIN travel.users ON venues.user_id = users.customer_id ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, location_lon, operating_hours from all venues.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, operating_hours FROM travel.venues;", "sql": null}, {"role": "user", "content": "List venues with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, operating_hours FROM travel.venues WHERE last_inspected >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, location_lon, operating_hours FROM travel.venues WHERE last_inspected >= CURRENT_DATE - INTERVAL '7 days' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me is_verified, last_active, booking_id for all users.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, last_active, booking_id FROM travel.users;", "sql": null}, {"role": "user", "content": "List users that have username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, last_active, booking_id FROM travel.users WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group users by last_active and show the max of last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, MAX(last_active) AS max_last_active FROM travel.users GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Show me last_inspected, operating_hours, is_verified, last_active from venues and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.is_verified, users.last_active FROM travel.venues JOIN travel.users ON venues.user_id = users.customer_id;", "sql": null}, {"role": "user", "content": "Tally up venues by geo_point.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM travel.venues GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "List booking_id, password_hash, username from users.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, password_hash, username FROM travel.users;", "sql": null}, {"role": "user", "content": "List users with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, password_hash, username FROM travel.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, password_hash, username FROM travel.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY username ASC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY username ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Get all users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many users are there per last_active?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM travel.users GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get last_inspected, longitude, geo_point from all venues.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, longitude, geo_point FROM travel.venues;", "sql": null}, {"role": "user", "content": "Get venues that match geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, longitude, geo_point FROM travel.venues WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, longitude, geo_point FROM travel.venues WHERE geo_point LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "List is_active, is_verified, password_hash from users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, password_hash FROM travel.users;", "sql": null}, {"role": "user", "content": "Find users where is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, password_hash FROM travel.users WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, password_hash FROM travel.users WHERE is_active = TRUE LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.venues (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_inspected timestamp without time zone,\n operating_hours text NOT NULL,\n geo_point character varying(64) NOT NULL,\n longitude character varying(128),\n location_lon varchar,\n user_id integer -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE travel.bookings (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n total smallint,\n approval_status varchar,\n seller_id character varying(64),\n payment_method text,\n quantity character varying(256),\n account_id text -- identifier for account\n)\n\nCREATE TABLE travel.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n password_hash text,\n username char,\n is_verified bit NOT NULL,\n is_active bit NOT NULL -- indicates if active is true,\n booking_id integer -- reference to bookings.invoice_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users;", "sql": null}, {"role": "user", "content": "Arrange the results with is_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY is_active DESC;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.users ORDER BY is_active DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Get completed_at, approval_status, invoice_id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, approval_status, invoice_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, approval_status, invoice_id FROM tradingplatform.orders ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, approval_status, invoice_id FROM tradingplatform.orders ORDER BY completed_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Can you order these by invoice_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY invoice_id ASC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY invoice_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show the results sorted by wallet_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY wallet_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by invoice_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY invoice_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve invoice_id, completed_at, invoice_number, debit showing the relationship between orders and wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.invoice_number, wallets.debit FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Tally up orders by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, subtotal, tax for every order.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, subtotal, tax FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by tax descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, subtotal, tax FROM tradingplatform.orders ORDER BY tax DESC;", "sql": null}, {"role": "user", "content": "Order the output by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, subtotal, tax FROM tradingplatform.orders ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Retrieve wallet_id, approval_status, tax for every order.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, approval_status, tax FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders with approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, approval_status, tax FROM tradingplatform.orders WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, approval_status, tax FROM tradingplatform.orders WHERE approval_status LIKE 'A%' ORDER BY wallet_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Count the number of orders in each invoice_id category.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY invoice_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by invoice_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY invoice_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY subtotal DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "What are the created_at, wallet_id, tax of each order?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, wallet_id, tax FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get subtotal, completed_at, payment_date, exchange_rate by joining orders with wallets.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, wallet_id, tax, wallets.payment_date, wallets.exchange_rate FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Calculate min of invoice_id for each tax in orders.", "sql": null}, {"role": "assistant", "content": "SELECT tax, MIN(invoice_id) AS min_invoice_id FROM tradingplatform.orders GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp,\n created_at date,\n tax numeric(38,14) NOT NULL,\n approval_status character varying(64),\n subtotal decimal,\n wallet_id integer -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n price numeric(38,14) NOT NULL,\n product_id text -- identifier for product,\n subtotal smallint,\n delivery_status varchar,\n user_id varchar,\n card_type text\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_date date,\n exchange_rate text,\n debit character varying(64) NOT NULL,\n invoice_number character varying(128),\n category text\n)", "conversations": [{"role": "user", "content": "List tax, approval_status, wallet_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT tax, approval_status, wallet_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What completed_at, wallet_id, category, updated_at do we have for orders and their associated wallets?", "sql": null}, {"role": "assistant", "content": "SELECT tax, approval_status, wallet_id, wallets.category, wallets.updated_at FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "List all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods;", "sql": null}, {"role": "user", "content": "Get goods that match quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of goods across different subcategory values.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, COUNT(*) AS count FROM inventory.goods GROUP BY subcategory ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "List quantity, image_url, subcategory from goods.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, image_url, subcategory FROM inventory.goods;", "sql": null}, {"role": "user", "content": "Show me goods with image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, image_url, subcategory FROM inventory.goods WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group goods by backorder and show the max of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, MAX(created_at) AS max_created_at FROM inventory.goods GROUP BY backorder;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods;", "sql": null}, {"role": "user", "content": "List goods that have location_id > 10.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods WHERE location_id > 10;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods WHERE location_id > 10 LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods;", "sql": null}, {"role": "user", "content": "What subcategory, backorder, updated_at, parking_available do we have for goods and their associated locations?", "sql": null}, {"role": "assistant", "content": "SELECT *, locations.updated_at, locations.parking_available FROM inventory.goods JOIN inventory.locations ON goods.location_id = locations.id;", "sql": null}, {"role": "user", "content": "Get max of image_url by image_url from goods.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MAX(image_url) AS max_image_url FROM inventory.goods GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me location_id, created_at, subcategory for all goods.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, created_at, subcategory FROM inventory.goods;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, created_at, subcategory FROM inventory.goods ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Get max of updated_at by subcategory from goods.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, MAX(updated_at) AS max_updated_at FROM inventory.goods GROUP BY subcategory;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "List created_at, backorder, image_url from goods.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, image_url FROM inventory.goods;", "sql": null}, {"role": "user", "content": "Get all goods created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, backorder, image_url FROM inventory.goods WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Group goods by image_url and show the average of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, AVERAGE(created_at) AS average_created_at FROM inventory.goods GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all goods.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM inventory.goods ORDER BY image_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me backorder, quantity, created_at for all goods.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, quantity, created_at FROM inventory.goods;", "sql": null}, {"role": "user", "content": "What location_id, subcategory, timezone, description do we have for goods and their associated locations?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, quantity, created_at, locations.timezone, locations.description FROM inventory.goods JOIN inventory.locations ON goods.location_id = locations.id;", "sql": null}, {"role": "user", "content": "Get min of created_at by quantity from goods.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, MIN(created_at) AS min_created_at FROM inventory.goods GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "List image_url, quantity, created_at from goods.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, quantity, created_at FROM inventory.goods;", "sql": null}, {"role": "user", "content": "List goods that have subcategory LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, quantity, created_at FROM inventory.goods WHERE subcategory LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, quantity, created_at FROM inventory.goods WHERE subcategory LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE inventory.goods (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n subcategory character varying(64) NOT NULL,\n image_url character varying(128) NOT NULL,\n backorder character varying(256),\n quantity character varying(256),\n location_id integer NOT NULL -- reference to locations.id,\n FOREIGN KEY (location_id) REFERENCES locations(id)\n)\n\nCREATE TABLE inventory.locations (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description char,\n parking_available text,\n timezone character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve location_id, created_at, quantity for every good.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, created_at, quantity FROM inventory.goods;", "sql": null}, {"role": "user", "content": "List goods that have location_id > 89.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, created_at, quantity FROM inventory.goods WHERE location_id > 89;", "sql": null}, {"role": "user", "content": "Group goods by quantity and show the count of location_id.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(location_id) AS count_location_id FROM inventory.goods GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the exchange_rate, traded_at, loan_id of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, traded_at, loan_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, traded_at, loan_id FROM finance.transactions WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of transactions in each total category.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM finance.transactions GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List card_type, loan_id, rating, views for each transaction along with their loan information.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.rating, loans.views FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Tally up transactions by total.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM finance.transactions GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get loan_id, card_type, score, subject by joining transactions with loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.score, loans.subject FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Tally up transactions by id.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM finance.transactions GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve transactions where total > 7.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE total > 7;", "sql": null}, {"role": "user", "content": "Show me the count of transactions grouped by loan_id.", "sql": null}, {"role": "assistant", "content": "SELECT loan_id, COUNT(*) AS count FROM finance.transactions GROUP BY loan_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve loan_id, card_type, score, updated_at showing the relationship between transactions and loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.score, loans.updated_at FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Sort the results by id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.score, loans.updated_at FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id ORDER BY id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY exchange_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "Get total, exchange_rate, id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT total, exchange_rate, id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List traded_at, total, updated_at, score for each transaction along with their loan information.", "sql": null}, {"role": "assistant", "content": "SELECT total, exchange_rate, id, loans.updated_at, loans.score FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different id values.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM finance.transactions GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions with exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE exchange_rate LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n exchange_rate text,\n total numeric NOT NULL,\n card_type character varying(128) NOT NULL,\n loan_id text -- reference to loans.content_id,\n FOREIGN KEY (loan_id) REFERENCES loans(content_id)\n)\n\nCREATE TABLE finance.loans (\n content_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n score character varying(256),\n rating character varying(128),\n views char,\n categories text NOT NULL,\n subject character varying(256)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Retrieve loan_id, card_type, views, categories showing the relationship between transactions and loans.", "sql": null}, {"role": "assistant", "content": "SELECT *, loans.views, loans.categories FROM finance.transactions JOIN finance.loans ON transactions.loan_id = loans.content_id;", "sql": null}, {"role": "user", "content": "Get max of card_type by id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT id, MAX(card_type) AS max_card_type FROM finance.transactions GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp,\n nationality text,\n last_name char NOT NULL,\n city character varying(64),\n state char NOT NULL,\n is_verified boolean -- indicates if verified is true,\n full_name text,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n created_at date,\n reference_number text NOT NULL,\n approval_status character varying(64) NOT NULL,\n reconciliation_status character varying(64),\n vendor_id char -- identifier for vendor,\n category char,\n medical_record_id integer -- reference to medical_records.id,\n appointment_id text -- reference to appointments.employee_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(employee_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n category char NOT NULL,\n vendor_id char,\n currency character varying(128),\n reconciliation_status character varying(64),\n payee_id character varying(256) -- identifier for payee,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "What are the state, city, full_name of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT state, city, full_name FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Can you order these by joined_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT state, city, full_name FROM healthcare.appointments ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT state, city, full_name FROM healthcare.appointments ORDER BY joined_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp,\n nationality text,\n last_name char NOT NULL,\n city character varying(64),\n state char NOT NULL,\n is_verified boolean -- indicates if verified is true,\n full_name text,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n created_at date,\n reference_number text NOT NULL,\n approval_status character varying(64) NOT NULL,\n reconciliation_status character varying(64),\n vendor_id char -- identifier for vendor,\n category char,\n medical_record_id integer -- reference to medical_records.id,\n appointment_id text -- reference to appointments.employee_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(employee_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n category char NOT NULL,\n vendor_id char,\n currency character varying(128),\n reconciliation_status character varying(64),\n payee_id character varying(256) -- identifier for payee,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where reconciliation_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE reconciliation_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE reconciliation_status LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n employee_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp,\n nationality text,\n last_name char NOT NULL,\n city character varying(64),\n state char NOT NULL,\n is_verified boolean -- indicates if verified is true,\n full_name text,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n created_at date,\n reference_number text NOT NULL,\n approval_status character varying(64) NOT NULL,\n reconciliation_status character varying(64),\n vendor_id char -- identifier for vendor,\n category char,\n medical_record_id integer -- reference to medical_records.id,\n appointment_id text -- reference to appointments.employee_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(employee_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n due_date timestamp,\n category char NOT NULL,\n vendor_id char,\n currency character varying(128),\n reconciliation_status character varying(64),\n payee_id character varying(256) -- identifier for payee,\n billin_id text -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY created_at DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, location_id, last_inspected for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_id, last_inspected FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors that have geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_id, last_inspected FROM healthcare.doctors WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of doctors grouped by location_lon.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, COUNT(*) AS count FROM healthcare.doctors GROUP BY location_lon ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve prescription_id, location_id, customer_id, debit showing the relationship between doctors and prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.customer_id, prescriptions.debit FROM healthcare.doctors JOIN healthcare.prescriptions ON doctors.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.customer_id, prescriptions.debit FROM healthcare.doctors JOIN healthcare.prescriptions ON doctors.prescription_id = prescriptions.id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Get location_id, accessibility, location_lon from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, accessibility, location_lon FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get doctors that match accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, accessibility, location_lon FROM healthcare.doctors WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group doctors by accessibility and show the max of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, MAX(updated_at) AS max_updated_at FROM healthcare.doctors GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY last_inspected ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of doctors in each accessibility category.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM healthcare.doctors GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "List last_inspected, updated_at, prescription_id from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, updated_at, prescription_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, updated_at, prescription_id FROM healthcare.doctors WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, updated_at, prescription_id FROM healthcare.doctors WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Get updated_at, location_lon, location_id from all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_lon, location_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, location_lon, location_id FROM healthcare.doctors WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group doctors by last_inspected and show the count of location_id.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(location_id) AS count_location_id FROM healthcare.doctors GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "List geo_point, updated_at, last_inspected from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, updated_at, last_inspected FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, updated_at, last_inspected FROM healthcare.doctors WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of doctors in each accessibility category.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM healthcare.doctors GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n last_inspected date,\n location_lon character varying(256),\n geo_point text,\n accessibility character varying(128),\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n customer_id varchar NOT NULL -- identifier for customer,\n user_id varchar -- identifier for user,\n approval_status varchar,\n reconciliation_status character varying(128) NOT NULL,\n description character varying(256),\n invoice_number char,\n debit character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me location_id, geo_point, accessibility for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, geo_point, accessibility FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, geo_point, accessibility FROM healthcare.doctors WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of doctors across different geo_point values.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM healthcare.doctors GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the min format for each published_at in messages?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, MIN(format) AS min_format FROM socialmedia.messages GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by message_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-12-01' ORDER BY message_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Can you order these by image_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY image_url DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by author_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at > '2023-01-01' ORDER BY author_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Get format, parent_id, published_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT format, parent_id, published_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT format, parent_id, published_at FROM socialmedia.messages ORDER BY post_id ASC;", "sql": null}, {"role": "user", "content": "Tally up messages by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM socialmedia.messages GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Get published_at, format, image_url from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, format, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, format, image_url FROM socialmedia.messages WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate sum of post_id for each image_url in messages.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, SUM(post_id) AS sum_post_id FROM socialmedia.messages GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve author_id, published_at, post_id for every message.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, published_at, post_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve format, published_at, updated_at, body showing the relationship between messages and posts.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, published_at, post_id, posts.updated_at, posts.body FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.id;", "sql": null}, {"role": "user", "content": "Sort the results by image_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, published_at, post_id, posts.updated_at, posts.body FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.id ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the format, image_url, parent_id of each message?", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, parent_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me author_id, image_url, visibility, body from messages and their related posts.", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, parent_id, posts.visibility, posts.body FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, parent_id, posts.visibility, posts.body FROM socialmedia.messages JOIN socialmedia.posts ON messages.post_id = posts.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve format, author_id, post_id for every message.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, post_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, post_id FROM socialmedia.messages WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT format, author_id, post_id FROM socialmedia.messages WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n parent_id character varying(64) NOT NULL,\n author_id character varying(256),\n image_url character varying(128),\n format character varying(128),\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.posts (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n visibility char,\n rating char,\n body character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me format, image_url, message_id for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, message_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, message_id FROM socialmedia.messages WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by format descending.", "sql": null}, {"role": "assistant", "content": "SELECT format, image_url, message_id FROM socialmedia.messages WHERE published_at > '2023-01-01' ORDER BY format DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Count the number of doctors in each patient_id category.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM healthcare.doctors GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List appointments that have postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up appointments by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM healthcare.appointments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors that have profile_picture_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE profile_picture_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group doctors by is_verified and show the min of patient_id.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, MIN(patient_id) AS min_patient_id FROM healthcare.doctors GROUP BY is_verified;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up doctors by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.doctors GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by first_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY first_name DESC;", "sql": null}, {"role": "user", "content": "Tally up doctors by profile_picture_url.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, COUNT(*) AS count FROM healthcare.doctors GROUP BY profile_picture_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me appointments that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE last_inspected > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up appointments by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM healthcare.appointments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get postal_code, last_inspected, last_name, appointment_id by joining appointments with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.last_name, patients.appointment_id FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.last_name, patients.appointment_id FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "What country, patient_id, doctor_id, password_hash do we have for doctors and their associated patients?", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.doctor_id, patients.password_hash FROM healthcare.doctors JOIN healthcare.patients ON doctors.patient_id = patients.id;", "sql": null}, {"role": "user", "content": "Sort the results by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.doctor_id, patients.password_hash FROM healthcare.doctors JOIN healthcare.patients ON doctors.patient_id = patients.id ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n profile_picture_url text,\n country text,\n first_name character varying(64),\n is_verified boolean,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.appointments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp without time zone,\n type character varying(256),\n address_line2 character varying(128),\n postal_code text,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.patients (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n token character varying(64),\n password_hash char,\n last_name character varying(64),\n address text,\n username character varying(128) NOT NULL,\n status character varying(128),\n appointment_id integer NOT NULL -- reference to appointments.location_id,\n doctor_id text NOT NULL -- reference to doctors.person_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(location_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE joined_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "What are the price, buyer_id, processed_at of each categorie?", "sql": null}, {"role": "assistant", "content": "SELECT price, buyer_id, processed_at FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List currency, processed_at, product_id, gender for each categorie along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT price, buyer_id, processed_at, users.product_id, users.gender FROM e-commerce.categories JOIN e-commerce.users ON categories.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of categories across different processed_at values.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM e-commerce.categories GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "What product_id, created_at, discount, expires_at do we have for users and their associated products?", "sql": null}, {"role": "assistant", "content": "SELECT *, products.discount, products.expires_at FROM e-commerce.users JOIN e-commerce.products ON users.product_id = products.barcode;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, products.discount, products.expires_at FROM e-commerce.users JOIN e-commerce.products ON users.product_id = products.barcode LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Show me user_id, product_id, buyer_id for all categories.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, product_id, buyer_id FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Get categories that match currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, product_id, buyer_id FROM e-commerce.categories WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of processed_at for each user_id in categories.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(processed_at) AS min_processed_at FROM e-commerce.categories GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, zip_code, created_at from all users.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, zip_code, created_at FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by zip_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, zip_code, created_at FROM e-commerce.users ORDER BY zip_code DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, zip_code, created_at FROM e-commerce.users ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, currency, product_id for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, product_id FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Can you order these by buyer_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, product_id FROM e-commerce.categories ORDER BY buyer_id DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with buyer_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, currency, product_id FROM e-commerce.categories ORDER BY buyer_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get all categories.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.categories ORDER BY buyer_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of categories in each approval_status category.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM e-commerce.categories GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Get buyer_id, processed_at, price from all categories.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, processed_at, price FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "Show me categories that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, processed_at, price FROM e-commerce.categories WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up categories by price.", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM e-commerce.categories GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "What are the age, zip_code, username of each user?", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, username FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "List gender, age, categorie_id, discount for each user along with their product information.", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, username, products.categorie_id, products.discount FROM e-commerce.users JOIN e-commerce.products ON users.product_id = products.barcode;", "sql": null}, {"role": "user", "content": "Arrange the results with age in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, username, products.categorie_id, products.discount FROM e-commerce.users JOIN e-commerce.products ON users.product_id = products.barcode ORDER BY age DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n age varchar,\n username character varying(256) NOT NULL,\n last_login date NOT NULL,\n zip_code character varying(256),\n gender character varying(256),\n product_id text NOT NULL -- reference to products.barcode,\n FOREIGN KEY (product_id) REFERENCES products(barcode)\n)\n\nCREATE TABLE e-commerce.products (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n image_url text NOT NULL,\n discount decimal,\n popularity_score text NOT NULL,\n featured_rank varchar,\n categorie_id integer -- reference to categories.payment_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n approval_status varchar,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n product_id character varying(256),\n price numeric(38,14),\n currency character varying(256),\n user_id integer -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, processed_at, currency for every categorie.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, processed_at, currency FROM e-commerce.categories;", "sql": null}, {"role": "user", "content": "List categories that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, processed_at, currency FROM e-commerce.categories WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group categories by approval_status and show the average of price.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, AVERAGE(price) AS average_price FROM e-commerce.categories GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve video_url, updated_at, reserved for every product.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, updated_at, reserved FROM gaming.products;", "sql": null}, {"role": "user", "content": "List subcategory, updated_at, created_at, timezone for each product along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, updated_at, reserved, students.created_at, students.timezone FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "How many products are there per image_url?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM gaming.products GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "List published_at, video_url, last_name, status for each product along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.last_name, students.status FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.last_name, students.status FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id ORDER BY thumbnail_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "List reserved, student_id, age, created_at for each product along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.age, students.created_at FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.age, students.created_at FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "List products with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the count updated_at for each image_url in products?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(updated_at) AS count_updated_at FROM gaming.products GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by student_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products ORDER BY student_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "Retrieve products where subcategory LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products WHERE subcategory LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of products across different reserved values.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM gaming.products GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me video_url, published_at, student_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, published_at, student_id FROM gaming.products;", "sql": null}, {"role": "user", "content": "Show me reserved, published_at, token, status from products and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, published_at, student_id, students.token, students.status FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT video_url, published_at, student_id, students.token, students.status FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products;", "sql": null}, {"role": "user", "content": "Sort the results by item_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM gaming.products ORDER BY item_id DESC;", "sql": null}, {"role": "user", "content": "How many products are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM gaming.products GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE gaming.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n published_at timestamp,\n subcategory character varying(256),\n reserved text NOT NULL,\n image_url varchar,\n thumbnail_url character varying(256),\n video_url character varying(256),\n student_id text -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE gaming.messages (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n published_at timestamp without time zone,\n parent_id varchar NOT NULL,\n keywords character varying(128) NOT NULL,\n user_id character varying(64) -- identifier for user,\n title character varying(256) NOT NULL\n)\n\nCREATE TABLE gaming.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp without time zone,\n last_name character varying(64),\n timezone text NOT NULL,\n age character varying(64) NOT NULL,\n status character varying(64) NOT NULL,\n token character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, student_id, image_url for every product.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, student_id, image_url FROM gaming.products;", "sql": null}, {"role": "user", "content": "Get video_url, thumbnail_url, last_name, age by joining products with students.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, student_id, image_url, students.last_name, students.age FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Sort the results by student_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, student_id, image_url, students.last_name, students.age FROM gaming.products JOIN gaming.students ON products.student_id = students.user_id ORDER BY student_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n city text,\n last_login timestamp without time zone,\n email char,\n is_verified boolean NOT NULL,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n profile_picture_url char,\n full_name character varying(128),\n bio character varying(64),\n birth_date date,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)\n\nCREATE TABLE healthcare.billing (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(256) NOT NULL,\n name varchar,\n description varchar NOT NULL,\n thumbnail_url character varying(64),\n manufacturer character varying(256),\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Order the output by manufacturer ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY manufacturer ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n city text,\n last_login timestamp without time zone,\n email char,\n is_verified boolean NOT NULL,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n profile_picture_url char,\n full_name character varying(128),\n bio character varying(64),\n birth_date date,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)\n\nCREATE TABLE healthcare.billing (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(256) NOT NULL,\n name varchar,\n description varchar NOT NULL,\n thumbnail_url character varying(64),\n manufacturer character varying(256),\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get updated_at, profile_picture_url, patient_id, last_active by joining patients with medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT *, medical_records.patient_id, medical_records.last_active FROM healthcare.patients JOIN healthcare.medical_records ON patients.medical_record_id = medical_records.id;", "sql": null}, {"role": "user", "content": "Calculate count of bio for each birth_date in patients.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(bio) AS count_bio FROM healthcare.patients GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n city text,\n last_login timestamp without time zone,\n email char,\n is_verified boolean NOT NULL,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n profile_picture_url char,\n full_name character varying(128),\n bio character varying(64),\n birth_date date,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)\n\nCREATE TABLE healthcare.billing (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(256) NOT NULL,\n name varchar,\n description varchar NOT NULL,\n thumbnail_url character varying(64),\n manufacturer character varying(256),\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get published_at, manufacturer, updated_at, profile_picture_url by joining billing with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.updated_at, patients.profile_picture_url FROM healthcare.billing JOIN healthcare.patients ON billing.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different thumbnail_url values.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM healthcare.billing GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n city text,\n last_login timestamp without time zone,\n email char,\n is_verified boolean NOT NULL,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n profile_picture_url char,\n full_name character varying(128),\n bio character varying(64),\n birth_date date,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)\n\nCREATE TABLE healthcare.billing (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(256) NOT NULL,\n name varchar,\n description varchar NOT NULL,\n thumbnail_url character varying(64),\n manufacturer character varying(256),\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, email, is_verified from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, email, is_verified FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show the results sorted by patient_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, email, is_verified FROM healthcare.medical_records ORDER BY patient_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each email category.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM healthcare.medical_records GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp,\n city text,\n last_login timestamp without time zone,\n email char,\n is_verified boolean NOT NULL,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n profile_picture_url char,\n full_name character varying(128),\n bio character varying(64),\n birth_date date,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)\n\nCREATE TABLE healthcare.billing (\n sku character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n video_url character varying(256) NOT NULL,\n name varchar,\n description varchar NOT NULL,\n thumbnail_url character varying(64),\n manufacturer character varying(256),\n patient_id integer NOT NULL -- reference to patients.user_id,\n medical_record_id integer -- reference to medical_records.id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id),\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(id)\n)", "conversations": [{"role": "user", "content": "Retrieve city, patient_id, is_verified for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT city, patient_id, is_verified FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve medical_records where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT city, patient_id, is_verified FROM healthcare.medical_records WHERE last_login BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get min of patient_id by city from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT city, MIN(patient_id) AS min_patient_id FROM healthcare.medical_records GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve description, visibility, likes for every notification.", "sql": null}, {"role": "assistant", "content": "SELECT description, visibility, likes FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT description, visibility, likes FROM tradingplatform.notifications WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me max of attachment_url grouped by likes for notifications.", "sql": null}, {"role": "assistant", "content": "SELECT likes, MAX(attachment_url) AS max_attachment_url FROM tradingplatform.notifications GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications where visibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE visibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many notifications are there per trade_id?", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY trade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get attachment_url, created_at, trade_id from all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, created_at, trade_id FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications that have attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, created_at, trade_id FROM tradingplatform.notifications WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of notifications grouped by likes.", "sql": null}, {"role": "assistant", "content": "SELECT likes, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY likes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me published_at, likes, description for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, likes, description FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications where trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, likes, description FROM tradingplatform.notifications WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, likes, description FROM tradingplatform.notifications WHERE trade_id LIKE 'A%' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the description, attachment_url, likes of each notification?", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, likes FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, likes FROM tradingplatform.notifications WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT description, attachment_url, likes FROM tradingplatform.notifications WHERE attachment_url LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me created_at, visibility, description for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, visibility, description FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me notifications with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, visibility, description FROM tradingplatform.notifications WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, visibility, description FROM tradingplatform.notifications WHERE created_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List published_at, description, account_id, discount for each notification along with their trade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.account_id, trades.discount FROM tradingplatform.notifications JOIN tradingplatform.trades ON notifications.trade_id = trades.id;", "sql": null}, {"role": "user", "content": "Get the distribution of notifications across different description values.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me visibility, trade_id, description for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, trade_id, description FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, trade_id, description FROM tradingplatform.notifications WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, trade_id, description FROM tradingplatform.notifications WHERE trade_id LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the published_at, created_at, likes of each notification?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, likes FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "What description, trade_id, payment_method, traded_at do we have for notifications and their associated trades?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, created_at, likes, trades.payment_method, trades.traded_at FROM tradingplatform.notifications JOIN tradingplatform.trades ON notifications.trade_id = trades.id;", "sql": null}, {"role": "user", "content": "Show me max of published_at grouped by trade_id for notifications.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, MAX(published_at) AS max_published_at FROM tradingplatform.notifications GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n discount bigint,\n payment_method character varying(256) NOT NULL,\n account_id text\n)\n\nCREATE TABLE tradingplatform.notifications (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n visibility char,\n description text NOT NULL,\n likes varchar,\n attachment_url character varying(256),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n reference_number character varying(128),\n debit char NOT NULL,\n status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List likes, description, visibility from notifications.", "sql": null}, {"role": "assistant", "content": "SELECT likes, description, visibility FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications that have likes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT likes, description, visibility FROM tradingplatform.notifications WHERE likes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT likes, description, visibility FROM tradingplatform.notifications WHERE likes LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "List updated_at, geo_point, postal_code from groups.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, postal_code FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve like_id, postal_code, attachment_url, image_url showing the relationship between groups and messages.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, postal_code, messages.attachment_url, messages.image_url FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Order the output by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, geo_point, postal_code, messages.attachment_url, messages.image_url FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "List all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate count of location_lon for each updated_at in groups.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(location_lon) AS count_location_lon FROM socialmedia.groups GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve type, postal_code, message_id for every group.", "sql": null}, {"role": "assistant", "content": "SELECT type, postal_code, message_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Sort the results by type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT type, postal_code, message_id FROM socialmedia.groups ORDER BY type ASC;", "sql": null}, {"role": "user", "content": "Show me min of postal_code grouped by message_id for groups.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, MIN(postal_code) AS min_postal_code FROM socialmedia.groups GROUP BY message_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "List all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List postal_code, geo_point, attachment_url, published_at for each group along with their message information.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.attachment_url, messages.published_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.attachment_url, messages.published_at FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Sort the results by like_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY like_id ASC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY like_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve groups where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many groups are there per updated_at?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.groups GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "List updated_at, postal_code, created_at from groups.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, postal_code, created_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Can you order these by postal_code ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, postal_code, created_at FROM socialmedia.groups ORDER BY postal_code ASC;", "sql": null}, {"role": "user", "content": "Tally up groups by message_id.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM socialmedia.groups GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "List type, like_id, location_lon from groups.", "sql": null}, {"role": "assistant", "content": "SELECT type, like_id, location_lon FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "What like_id, venue_id, description, attachment_url do we have for groups and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT type, like_id, location_lon, messages.description, messages.attachment_url FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "What is the max message_id for each postal_code in groups?", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, MAX(message_id) AS max_message_id FROM socialmedia.groups GROUP BY postal_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the venue_id, like_id, updated_at of each group?", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, like_id, updated_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "What postal_code, created_at, image_url, attachment_url do we have for groups and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, like_id, updated_at, messages.image_url, messages.attachment_url FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id;", "sql": null}, {"role": "user", "content": "Can you order these by venue_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, like_id, updated_at, messages.image_url, messages.attachment_url FROM socialmedia.groups JOIN socialmedia.messages ON groups.message_id = messages.message_id ORDER BY venue_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n venue_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n location_lon varchar NOT NULL,\n postal_code char,\n geo_point varchar,\n type varchar,\n message_id text NOT NULL -- reference to messages.message_id,\n like_id text -- reference to likes.employee_id,\n FOREIGN KEY (message_id) REFERENCES messages(message_id),\n FOREIGN KEY (like_id) REFERENCES likes(employee_id)\n)\n\nCREATE TABLE socialmedia.likes (\n employee_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n username varchar NOT NULL,\n zip_code character varying(128) NOT NULL,\n api_key text NOT NULL,\n bio char NOT NULL,\n timezone character varying(128),\n age character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.messages (\n message_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n attachment_url char NOT NULL,\n image_url character varying(256),\n description character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "What is the max created_at for each type in groups?", "sql": null}, {"role": "assistant", "content": "SELECT type, MAX(created_at) AS max_created_at FROM socialmedia.groups GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Get logs that match currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group logs by amount and show the max of amount.", "sql": null}, {"role": "assistant", "content": "SELECT amount, MAX(amount) AS max_amount FROM tradingplatform.logs GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Order the output by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY amount DESC;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY amount DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Get logs that match id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "List id, amount, completed_at from logs.", "sql": null}, {"role": "assistant", "content": "SELECT id, amount, completed_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve logs where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT id, amount, completed_at FROM tradingplatform.logs WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Can you order these by tax ascending?", "sql": null}, {"role": "assistant", "content": "SELECT id, amount, completed_at FROM tradingplatform.logs WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY tax ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the completed_at, currency, amount of each log?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, currency, amount FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve currency, created_at, delivery_status, customer_id showing the relationship between logs and trades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, currency, amount, trades.delivery_status, trades.customer_id FROM tradingplatform.logs JOIN tradingplatform.trades ON logs.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "What is the min status for each tax in logs?", "sql": null}, {"role": "assistant", "content": "SELECT tax, MIN(status) AS min_status FROM tradingplatform.logs GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get status, tax, created_at from all logs.", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, created_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs that have trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, created_at FROM tradingplatform.logs WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, created_at FROM tradingplatform.logs WHERE trade_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Sort the results by tax descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY tax DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get average of tax by status from logs.", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(tax) AS average_tax FROM tradingplatform.logs GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve logs where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n created_at timestamp without time zone,\n tax integer,\n currency character varying(128),\n status text NOT NULL,\n amount decimal,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n customer_id character varying(128),\n amount integer,\n quantity text,\n buyer_id character varying(256) NOT NULL -- identifier for buyer,\n delivery_status text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by status descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "What are the store_id, longitude, appointment_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT store_id, longitude, appointment_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "What accessibility, description, image_url, message do we have for billing and their associated appointments?", "sql": null}, {"role": "assistant", "content": "SELECT store_id, longitude, appointment_id, appointments.image_url, appointments.message FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.content_id;", "sql": null}, {"role": "user", "content": "Count the number of billing in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.billing GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "What are the description, created_at, store_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT description, created_at, store_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT description, created_at, store_id FROM healthcare.billing WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many billing are there per accessibility?", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM healthcare.billing GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, appointment_id, description for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, appointment_id, description FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have store_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, appointment_id, description FROM healthcare.billing WHERE store_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different longitude values.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(*) AS count FROM healthcare.billing GROUP BY longitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by category descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY category DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by store_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY store_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different category values.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM healthcare.billing GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "What description, category, message, thumbnail do we have for billing and their associated appointments?", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.message, appointments.thumbnail FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.content_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.message, appointments.thumbnail FROM healthcare.billing JOIN healthcare.appointments ON billing.appointment_id = appointments.content_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "What are the description, longitude, appointment_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT description, longitude, appointment_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get billing that match longitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, longitude, appointment_id FROM healthcare.billing WHERE longitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of billing across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.billing GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY accessibility ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with accessibility in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY accessibility DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n thumbnail character varying(256),\n message char,\n image_url character varying(256),\n title char NOT NULL\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n timezone character varying(64),\n nationality varchar,\n website char NOT NULL,\n username character varying(256)\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n last_name char NOT NULL,\n status character varying(256),\n nationality varchar NOT NULL\n)\n\nCREATE TABLE healthcare.billing (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n accessibility character varying(128) NOT NULL,\n category character varying(256),\n timezone character varying(128) NOT NULL,\n description character varying(64) NOT NULL,\n longitude text,\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)", "conversations": [{"role": "user", "content": "Get store_id, accessibility, timezone from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, accessibility, timezone FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing with store_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, accessibility, timezone FROM healthcare.billing WHERE store_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group billing by accessibility and show the average of description.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, AVERAGE(description) AS average_description FROM healthcare.billing GROUP BY accessibility;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE processed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up wallets by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "How many assets are there per price?", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM tradingplatform.assets GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "List user_id, created_at, manufacturer from assets.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, created_at, manufacturer FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets where discount > 11.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, created_at, manufacturer FROM tradingplatform.assets WHERE discount > 11;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, created_at, manufacturer FROM tradingplatform.assets WHERE discount > 11 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with manufacturer in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY manufacturer DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve wallets where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE user_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Retrieve id, approval_status, price, created_at showing the relationship between wallets and assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.price, assets.created_at FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.barcode;", "sql": null}, {"role": "user", "content": "Get the distribution of wallets across different id values.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Display all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Sort the results by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Show me the count of wallets grouped by vendor_id.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n manufacturer character varying(64),\n price integer,\n discount numeric,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n processed_at timestamp without time zone,\n payer_id character varying(128) NOT NULL,\n vendor_id character varying(256) -- identifier for vendor,\n approval_status character varying(256),\n asset_id integer -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n joined_at timestamp,\n username character varying(128),\n zip_code varchar,\n nationality char\n)", "conversations": [{"role": "user", "content": "Get user_id, price, created_at from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, price, created_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, price, created_at FROM tradingplatform.assets ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "How many assets are there per manufacturer?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, COUNT(*) AS count FROM tradingplatform.assets GROUP BY manufacturer ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY user_id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the payment_status, completed_at, user_id of each order?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, user_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, user_id FROM tradingplatform.orders WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by seller_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, completed_at, user_id FROM tradingplatform.orders WHERE completed_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY seller_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What order_id, published_at, seller_id, approval_status do we have for assets and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.seller_id, orders.approval_status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Can you order these by image_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.seller_id, orders.approval_status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with delivery_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY delivery_status ASC;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, language, order_id for every user.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, language, order_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, language, order_id FROM tradingplatform.users WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of email for each language in users.", "sql": null}, {"role": "assistant", "content": "SELECT language, AVERAGE(email) AS average_email FROM tradingplatform.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve featured_rank, updated_at, order_id for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, order_id FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get all assets from last week.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, order_id FROM tradingplatform.assets WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, updated_at, order_id FROM tradingplatform.assets WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "What published_at, updated_at, completed_at, status do we have for assets and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.completed_at, orders.status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.completed_at, orders.status FROM tradingplatform.assets JOIN tradingplatform.orders ON assets.order_id = orders.invoice_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n subcategory character varying(256) NOT NULL,\n featured_rank char,\n image_url varchar,\n order_id integer -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id integer PRIMARY KEY -- unique identifier,\n completed_at date,\n status character varying(64) NOT NULL,\n payment_status character varying(64),\n quantity character varying(128) NOT NULL,\n seller_id character varying(256) -- identifier for seller,\n delivery_status character varying(256) NOT NULL,\n approval_status text,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n password_hash char,\n profile_picture_url varchar,\n email character varying(64),\n birth_date timestamp,\n token text NOT NULL,\n language varchar,\n timezone varchar NOT NULL,\n order_id integer NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get status, quantity, delivery_status from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT status, quantity, delivery_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT status, quantity, delivery_status FROM tradingplatform.orders WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Sort the results by quantity descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, quantity, delivery_status FROM tradingplatform.orders WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content;", "sql": null}, {"role": "user", "content": "Retrieve content where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate count of thumbnail for each published_at in content.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(thumbnail) AS count_thumbnail FROM logistics.content GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Retrieve categories, attachment_url, image_url for every content.", "sql": null}, {"role": "assistant", "content": "SELECT categories, attachment_url, image_url FROM logistics.content;", "sql": null}, {"role": "user", "content": "Get content that match image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT categories, attachment_url, image_url FROM logistics.content WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT categories, attachment_url, image_url FROM logistics.content WHERE image_url LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Display all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content;", "sql": null}, {"role": "user", "content": "Show me content that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by parent_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY parent_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "List likes, image_url, published_at from content.", "sql": null}, {"role": "assistant", "content": "SELECT likes, image_url, published_at FROM logistics.content;", "sql": null}, {"role": "user", "content": "Get content that match edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT likes, image_url, published_at FROM logistics.content WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the sum edited_at for each attachment_url in content?", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, SUM(edited_at) AS sum_edited_at FROM logistics.content GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with seller_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.orders ORDER BY seller_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.orders ORDER BY seller_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "What are the attachment_url, image_url, thumbnail of each content?", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, image_url, thumbnail FROM logistics.content;", "sql": null}, {"role": "user", "content": "List content that have likes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, image_url, thumbnail FROM logistics.content WHERE likes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by categories descending.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, image_url, thumbnail FROM logistics.content WHERE likes LIKE 'A%' ORDER BY categories DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Get all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content;", "sql": null}, {"role": "user", "content": "Arrange the results with image_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.content ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "List parent_id, likes, thumbnail from content.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, likes, thumbnail FROM logistics.content;", "sql": null}, {"role": "user", "content": "Can you order these by parent_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, likes, thumbnail FROM logistics.content ORDER BY parent_id ASC;", "sql": null}, {"role": "user", "content": "Calculate average of categories for each thumbnail in content.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, AVERAGE(categories) AS average_categories FROM logistics.content GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.orders;", "sql": null}, {"role": "user", "content": "Find orders from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM logistics.orders WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different id values.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM logistics.orders GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE logistics.content (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp,\n likes character varying(128),\n image_url character varying(256),\n categories character varying(256) NOT NULL,\n attachment_url character varying(64) NOT NULL,\n parent_id character varying(256) -- identifier for parent,\n thumbnail character varying(256)\n)\n\nCREATE TABLE logistics.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n processed_at timestamp,\n payment_method character varying(256),\n price numeric(38,14) NOT NULL,\n payment_status char NOT NULL,\n status character varying(256),\n seller_id char -- identifier for seller,\n product_id character varying(128) -- identifier for product\n)", "conversations": [{"role": "user", "content": "Show me edited_at, thumbnail, categories for all content.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, categories FROM logistics.content;", "sql": null}, {"role": "user", "content": "Get content that match attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, categories FROM logistics.content WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, thumbnail, categories FROM logistics.content WHERE attachment_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "What are the name, operating_hours, accessibility of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT name, operating_hours, accessibility FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT name, operating_hours, accessibility FROM e-commerce.order_items ORDER BY name ASC;", "sql": null}, {"role": "user", "content": "Group order_items by last_inspected and show the count of name.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(name) AS count_name FROM e-commerce.order_items GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "Show me accessibility, last_inspected, product_id for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, last_inspected, product_id FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, last_inspected, product_id FROM e-commerce.order_items WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group order_items by latitude and show the average of last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, AVERAGE(last_inspected) AS average_last_inspected FROM e-commerce.order_items GROUP BY latitude;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "List latitude, last_inspected, accessibility from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, last_inspected, accessibility FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get product_id, operating_hours, featured_rank, updated_at by joining order_items with products.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, last_inspected, accessibility, products.featured_rank, products.updated_at FROM e-commerce.order_items JOIN e-commerce.products ON order_items.product_id = products.id;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, last_inspected, accessibility, products.featured_rank, products.updated_at FROM e-commerce.order_items JOIN e-commerce.products ON order_items.product_id = products.id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with name in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY name DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY name DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of products across different reserved values.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM e-commerce.products GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "Show me featured_rank, reserved, name for all products.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, reserved, name FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List order_item_id, video_url, accessibility, name for each product along with their order_item information.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, reserved, name, order_items.accessibility, order_items.name FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, reserved, name, order_items.accessibility, order_items.name FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.store_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "What are the order_item_id, video_url, category of each product?", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, video_url, category FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by reserved descending.", "sql": null}, {"role": "assistant", "content": "SELECT order_item_id, video_url, category FROM e-commerce.products ORDER BY reserved DESC;", "sql": null}, {"role": "user", "content": "What is the max reserved for each category in products?", "sql": null}, {"role": "assistant", "content": "SELECT category, MAX(reserved) AS max_reserved FROM e-commerce.products GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "Show me name, reserved, order_item_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT name, reserved, order_item_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with category in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT name, reserved, order_item_id FROM e-commerce.products ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT name, reserved, order_item_id FROM e-commerce.products ORDER BY category DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "List all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with accessibility in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY accessibility ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by operating_hours ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY operating_hours ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n featured_rank char,\n video_url char NOT NULL,\n reserved character varying(128),\n name varchar,\n category char,\n order_item_id text -- reference to order_items.store_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(store_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n store_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n latitude varchar,\n operating_hours text,\n name text,\n accessibility character varying(256),\n product_id text -- reference to products.id,\n FOREIGN KEY (product_id) REFERENCES products(id)\n)", "conversations": [{"role": "user", "content": "List category, reserved, featured_rank from products.", "sql": null}, {"role": "assistant", "content": "SELECT category, reserved, featured_rank FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get name, reserved, name, latitude by joining products with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT category, reserved, featured_rank, order_items.name, order_items.latitude FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.store_id;", "sql": null}, {"role": "user", "content": "Order the output by order_item_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, reserved, featured_rank, order_items.name, order_items.latitude FROM e-commerce.products JOIN e-commerce.order_items ON products.order_item_id = order_items.store_id ORDER BY order_item_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by location_lat ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY location_lat ASC;", "sql": null}, {"role": "user", "content": "Group assignments by department_id and show the average of department_id.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, AVERAGE(department_id) AS average_department_id FROM education.assignments GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "What are the department_id, location_id, zip_code of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT department_id, location_id, zip_code FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, location_id, zip_code FROM education.assignments ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, location_id, zip_code FROM education.assignments ORDER BY created_at DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve zip_code, address_line2, location_lat for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, address_line2, location_lat FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, address_line2, location_lat FROM education.assignments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, address_line2, location_lat FROM education.assignments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List address_line2, zip_code, location_lat from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, zip_code, location_lat FROM education.assignments;", "sql": null}, {"role": "user", "content": "List location_id, location_lat, created_at, tax_rate for each assignment along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, zip_code, location_lat, departments.created_at, departments.tax_rate FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Order the output by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, zip_code, location_lat, departments.created_at, departments.tax_rate FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Get created_at, department_id, location_id from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, department_id, location_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, department_id, location_id FROM education.assignments ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Group assignments by location_lat and show the max of location_id.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, MAX(location_id) AS max_location_id FROM education.assignments GROUP BY location_lat;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group assignments by address_line2 and show the sum of zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, SUM(zip_code) AS sum_zip_code FROM education.assignments GROUP BY address_line2;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get description, location_id, available, brand by joining assignments with departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.available, departments.brand FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.available, departments.brand FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by address_line2 descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY address_line2 DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY address_line2 DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many assignments are there per location_lat?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM education.assignments GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n payment_status varchar,\n approval_status varchar,\n payment_method character varying(256),\n card_type character varying(128)\n)\n\nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n available text,\n subcategory char NOT NULL,\n tax_rate varchar,\n brand character varying(64) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n location_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n description char NOT NULL,\n zip_code varchar NOT NULL,\n address_line2 character varying(64),\n location_lat varchar,\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by location_lat ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY location_lat ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY location_lat ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "What are the id, product_id, price of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT id, product_id, price FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where price > 62.", "sql": null}, {"role": "assistant", "content": "SELECT id, product_id, price FROM education.grades WHERE price > 62;", "sql": null}, {"role": "user", "content": "Group grades by id and show the average of department_id.", "sql": null}, {"role": "assistant", "content": "SELECT id, AVERAGE(department_id) AS average_department_id FROM education.grades GROUP BY id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of grades in each payment_method category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM education.grades GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with department_id > 7.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE department_id > 7;", "sql": null}, {"role": "user", "content": "Calculate min of timezone for each timezone in students.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MIN(timezone) AS min_timezone FROM education.students GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "What is the average last_active for each gender in students?", "sql": null}, {"role": "assistant", "content": "SELECT gender, AVERAGE(last_active) AS average_last_active FROM education.students GROUP BY gender;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me price, department_id, quantity for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT price, department_id, quantity FROM education.grades;", "sql": null}, {"role": "user", "content": "Show the results sorted by traded_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT price, department_id, quantity FROM education.grades ORDER BY traded_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of grades in each price category.", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM education.grades GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of grades in each quantity category.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM education.grades GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Can you order these by last_name descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_name DESC;", "sql": null}, {"role": "user", "content": "Tally up students by gender.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM education.students GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me last_active, last_name, joined_at for all students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_name, joined_at FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve timezone, department_id, image_url, user_id showing the relationship between students and departments.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, last_name, joined_at, departments.image_url, departments.user_id FROM education.students JOIN education.departments ON students.department_id = departments.id;", "sql": null}, {"role": "user", "content": "What is the count last_name for each last_active in students?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(last_name) AS count_last_name FROM education.students GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Sort the results by department_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE traded_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY department_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n timezone character varying(64),\n gender text,\n last_name text,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.grades (\n id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n price decimal NOT NULL,\n payment_method char,\n product_id character varying(256) NOT NULL,\n quantity char,\n department_id integer NOT NULL -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)\n\nCREATE TABLE education.departments (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n image_url varchar NOT NULL,\n user_id varchar -- identifier for user,\n media_url varchar,\n views character varying(128),\n parent_id character varying(128) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List department_id, timezone, joined_at from students.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, timezone, joined_at FROM education.students;", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, timezone, joined_at FROM education.students ORDER BY joined_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, timezone, joined_at FROM education.students ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get profile_picture_url, updated_at, created_at, timezone by joining followers with events.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.created_at, events.timezone FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.person_id;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.created_at, events.timezone FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.person_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, timezone, profile_picture_url for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, timezone, profile_picture_url FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, timezone, profile_picture_url FROM socialmedia.followers WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of event_id grouped by timezone for followers.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, MIN(event_id) AS min_event_id FROM socialmedia.followers GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.followers GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY created_at DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, profile_picture_url, last_login for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, profile_picture_url, last_login FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, profile_picture_url, last_login FROM socialmedia.followers WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, profile_picture_url, last_login FROM socialmedia.followers WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "List timezone, last_login, event_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, event_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by last_login descending?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_login, event_id FROM socialmedia.followers ORDER BY last_login DESC;", "sql": null}, {"role": "user", "content": "Count the number of followers in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.followers GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Show me updated_at, created_at, timezone for all followers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, timezone FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What last_login, event_id, timezone, is_active do we have for followers and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, timezone, events.timezone, events.is_active FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.person_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, timezone, events.timezone, events.is_active FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.person_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "List profile_picture_url, updated_at, event_id from followers.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, updated_at, event_id FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by last_login descending?", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, updated_at, event_id FROM socialmedia.followers ORDER BY last_login DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with event_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, updated_at, event_id FROM socialmedia.followers ORDER BY event_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by timezone descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY timezone DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different profile_picture_url values.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, COUNT(*) AS count FROM socialmedia.followers GROUP BY profile_picture_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n last_login timestamp,\n timezone character varying(64) NOT NULL,\n profile_picture_url character varying(64),\n event_id text -- reference to events.person_id,\n FOREIGN KEY (event_id) REFERENCES events(person_id)\n)\n\nCREATE TABLE socialmedia.posts (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at date,\n likes character varying(128),\n content char NOT NULL,\n parent_id character varying(64) NOT NULL -- identifier for parent\n)\n\nCREATE TABLE socialmedia.events (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n timezone text,\n is_active bit NOT NULL,\n bio character varying(64),\n nationality text\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with event_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY event_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve api_key, last_active, seller_id, completed_at showing the relationship between prescriptions and billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.seller_id, billing.completed_at FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "How many prescriptions are there per id?", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "What are the full_name, phone, billin_id of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, phone, billin_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve prescriptions where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, phone, billin_id FROM healthcare.prescriptions WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Count the number of prescriptions in each billin_id category.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY billin_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List last_active, api_key, billin_id from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, api_key, billin_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions where billin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, api_key, billin_id FROM healthcare.prescriptions WHERE billin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different language values.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY language ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List billin_id, full_name, language from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, full_name, language FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List billin_id, last_active, user_id, processed_at for each prescription along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, full_name, language, billing.user_id, billing.processed_at FROM healthcare.prescriptions JOIN healthcare.billing ON prescriptions.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Show me average of last_login grouped by api_key for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, AVERAGE(last_login) AS average_last_login FROM healthcare.prescriptions GROUP BY api_key;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Order the output by last_login ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_login ASC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_login ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_login ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_login ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY last_login ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List prescriptions with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE last_login BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of prescriptions in each last_active category.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "What are the language, billin_id, phone of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, phone FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get prescriptions that match api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, phone FROM healthcare.prescriptions WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT language, billin_id, phone FROM healthcare.prescriptions WHERE api_key LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve prescriptions where language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE language LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n processed_at date,\n seller_id character varying(128) -- identifier for seller,\n discount numeric(38,14),\n user_id character varying(64) NOT NULL -- identifier for user,\n payment_status character varying(128),\n total smallint NOT NULL,\n amount decimal\n)\n\nCREATE TABLE healthcare.prescriptions (\n id character varying(64) NOT NULL -- unique identifier,\n last_active timestamp without time zone,\n full_name character varying(64),\n language varchar,\n api_key char,\n last_login timestamp,\n phone character varying(64) NOT NULL,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List prescriptions with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE last_login >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with api_key in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE last_login >= CURRENT_DATE - INTERVAL '30 days' ORDER BY api_key DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payer_id character varying(128),\n verification_status character varying(128),\n user_id varchar -- identifier for user,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n message character varying(64) NOT NULL,\n attachment_url char,\n image_url character varying(128) NOT NULL,\n views char,\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n cancelled_at date,\n customer_id character varying(128) NOT NULL,\n user_id character varying(256),\n product_id text NOT NULL,\n payment_method varchar NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n birth_date timestamp,\n username varchar,\n age varchar,\n last_login timestamp without time zone NOT NULL,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Order the output by message_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payer_id character varying(128),\n verification_status character varying(128),\n user_id varchar -- identifier for user,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n message character varying(64) NOT NULL,\n attachment_url char,\n image_url character varying(128) NOT NULL,\n views char,\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n cancelled_at date,\n customer_id character varying(128) NOT NULL,\n user_id character varying(256),\n product_id text NOT NULL,\n payment_method varchar NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n birth_date timestamp,\n username varchar,\n age varchar,\n last_login timestamp without time zone NOT NULL,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY customer_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payer_id character varying(128),\n verification_status character varying(128),\n user_id varchar -- identifier for user,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.investments (\n message_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n message character varying(64) NOT NULL,\n attachment_url char,\n image_url character varying(128) NOT NULL,\n views char,\n reply_to_id varchar NOT NULL -- identifier for reply_to,\n customer_id text NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n cancelled_at date,\n customer_id character varying(128) NOT NULL,\n user_id character varying(256),\n product_id text NOT NULL,\n payment_method varchar NOT NULL\n)\n\nCREATE TABLE finance.customers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n birth_date timestamp,\n username varchar,\n age varchar,\n last_login timestamp without time zone NOT NULL,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_login > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get processed_at, event_id, approval_status from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, event_id, approval_status FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, event_id, approval_status FROM socialmedia.followers WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, event_id, approval_status FROM socialmedia.followers WHERE processed_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with reference_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE reference_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE reference_number LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Retrieve event_id, processed_at, currency for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, processed_at, currency FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, processed_at, currency FROM socialmedia.followers ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of followers across different transaction_id values.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match payee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE payee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by user_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE payee_id LIKE 'A%' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "How many followers are there per currency?", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM socialmedia.followers GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What payee_id, event_id, user_id, categories do we have for followers and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.user_id, events.categories FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.id;", "sql": null}, {"role": "user", "content": "Sort the results by reference_number descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.user_id, events.categories FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.id ORDER BY reference_number DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "What transaction_id, event_id, categories, rating do we have for followers and their associated events?", "sql": null}, {"role": "assistant", "content": "SELECT *, events.categories, events.rating FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.id;", "sql": null}, {"role": "user", "content": "Get sum of approval_status by processed_at from followers.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, SUM(approval_status) AS sum_approval_status FROM socialmedia.followers GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List processed_at, user_id, updated_at, categories for each follower along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.updated_at, events.categories FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.id;", "sql": null}, {"role": "user", "content": "Count the number of followers in each transaction_id category.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Find followers where reference_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE reference_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE reference_number LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n user_id varchar,\n categories character varying(64),\n rating char NOT NULL,\n visibility varchar\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n payee_id character varying(256) -- identifier for payee,\n user_id character varying(64) -- identifier for user,\n reference_number character varying(64) NOT NULL,\n approval_status char,\n currency text,\n event_id text -- reference to events.id,\n FOREIGN KEY (event_id) REFERENCES events(id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by reference_number descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY reference_number DESC;", "sql": null}, {"role": "user", "content": "Get min of transaction_id by approval_status from followers.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MIN(transaction_id) AS min_transaction_id FROM socialmedia.followers GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "List user_id, fee, updated_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, fee, updated_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, fee, updated_at FROM socialmedia.events WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, fee, updated_at FROM socialmedia.events WHERE updated_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get all events created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE processed_at > '2023-12-01' ORDER BY user_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, account_id, user_id of each event?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, account_id, user_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, account_id, user_id FROM socialmedia.events ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, account_id, user_id FROM socialmedia.events ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me fee, updated_at, message_id for all events.", "sql": null}, {"role": "assistant", "content": "SELECT fee, updated_at, message_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT fee, updated_at, message_id FROM socialmedia.events WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT fee, updated_at, message_id FROM socialmedia.events WHERE updated_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, updated_at, message_id for every event.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, message_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me updated_at, account_id, title, message from events and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, message_id, messages.title, messages.message FROM socialmedia.events JOIN socialmedia.messages ON events.message_id = messages.comment_id;", "sql": null}, {"role": "user", "content": "Sort the results by message_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, updated_at, message_id, messages.title, messages.message FROM socialmedia.events JOIN socialmedia.messages ON events.message_id = messages.comment_id ORDER BY message_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Can you order these by account_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Display all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by fee descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY fee DESC;", "sql": null}, {"role": "user", "content": "Group events by processed_at and show the average of processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, AVERAGE(processed_at) AS average_processed_at FROM socialmedia.events GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the account_id, user_id, processed_at of each event?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, user_id, processed_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, user_id, processed_at FROM socialmedia.events WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of events across different fee values.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(*) AS count FROM socialmedia.events GROUP BY fee ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me account_id, updated_at, fee for all events.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, updated_at, fee FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, updated_at, fee FROM socialmedia.events WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, updated_at, fee FROM socialmedia.events WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at date,\n account_id varchar NOT NULL -- identifier for account,\n user_id text NOT NULL,\n fee text,\n message_id text -- reference to messages.comment_id,\n FOREIGN KEY (message_id) REFERENCES messages(comment_id)\n)\n\nCREATE TABLE socialmedia.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n attachment_url varchar,\n image_url character varying(128),\n title character varying(256) NOT NULL,\n format char,\n message varchar NOT NULL,\n rating text,\n thumbnail character varying(128)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n keywords character varying(64),\n views character varying(64),\n user_id character varying(256),\n shares char,\n text character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Can you order these by account_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY account_id DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages with attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE attachment_url LIKE 'A%' ORDER BY comment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get first_name, created_at, last_login from all users.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, created_at, last_login FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, created_at, last_login FROM socialmedia.users WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group users by first_name and show the sum of user_id.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, SUM(user_id) AS sum_user_id FROM socialmedia.users GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Find users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List user_id, comment_id, visibility, image_url for each user along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.visibility, comments.image_url FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.visibility, comments.image_url FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.message_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "What last_login, created_at, media_url, visibility do we have for users and their associated comments?", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.media_url, comments.visibility FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.message_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by comment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, comments.media_url, comments.visibility FROM socialmedia.users JOIN socialmedia.comments ON users.comment_id = comments.message_id ORDER BY comment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "List user_id, last_login, comment_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, last_login, comment_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by profile_picture_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, last_login, comment_id FROM socialmedia.users ORDER BY profile_picture_url DESC;", "sql": null}, {"role": "user", "content": "Group users by profile_picture_url and show the average of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, AVERAGE(created_at) AS average_created_at FROM socialmedia.users GROUP BY profile_picture_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Order the output by thumbnail descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY thumbnail DESC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY thumbnail DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve attachment_url, thumbnail, visibility for every message.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, thumbnail, visibility FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by attachment_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, thumbnail, visibility FROM socialmedia.messages ORDER BY attachment_url DESC;", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Order the output by thumbnail descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY thumbnail DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n visibility character varying(64),\n user_id character varying(64) NOT NULL -- identifier for user,\n thumbnail varchar,\n attachment_url varchar,\n post_id text NOT NULL -- reference to posts.content_id,\n FOREIGN KEY (post_id) REFERENCES posts(content_id)\n)\n\nCREATE TABLE socialmedia.comments (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n visibility text,\n image_url character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n joined_at date,\n first_name varchar NOT NULL,\n last_login timestamp,\n profile_picture_url character varying(256),\n comment_id integer -- reference to comments.message_id,\n FOREIGN KEY (comment_id) REFERENCES comments(message_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n views character varying(128) NOT NULL,\n reply_to_id varchar,\n tags character varying(64) NOT NULL,\n thumbnail character varying(64),\n author_id text NOT NULL -- identifier for author\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Can you order these by profile_picture_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY profile_picture_url ASC;", "sql": null}, {"role": "user", "content": "Get average of profile_picture_url by first_name from users.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, AVERAGE(profile_picture_url) AS average_profile_picture_url FROM socialmedia.users GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me quantity, views, token, age from products and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.token, users.age FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by quantity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.token, users.age FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.person_id ORDER BY quantity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Get status, last_active, website from all users.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, website FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get users that match age LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, website FROM e-commerce.users WHERE age LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of last_name grouped by display_name for users.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, SUM(last_name) AS sum_last_name FROM e-commerce.users GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, price, user_id for every product.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, price, user_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with published_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, price, user_id FROM e-commerce.products ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Get max of views by popularity_score from products.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, MAX(views) AS max_views FROM e-commerce.products GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get price, user_id, website, categorie_id by joining products with users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.website, users.categorie_id FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "What is the average popularity_score for each price in products?", "sql": null}, {"role": "assistant", "content": "SELECT price, AVERAGE(popularity_score) AS average_popularity_score FROM e-commerce.products GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What quantity, popularity_score, categorie_id, age do we have for products and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT *, users.categorie_id, users.age FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Get average of expires_at by quantity from products.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, AVERAGE(expires_at) AS average_expires_at FROM e-commerce.products GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me last_active, website, display_name for all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, display_name FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, display_name FROM e-commerce.users ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, display_name FROM e-commerce.users ORDER BY last_active ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me expires_at, views, user_id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, user_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me views, price, last_name, display_name from products and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, user_id, users.last_name, users.display_name FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.person_id;", "sql": null}, {"role": "user", "content": "Get sum of user_id by user_id from products.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(user_id) AS sum_user_id FROM e-commerce.products GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day' ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "Show me categorie_id, token, display_name for all users.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, token, display_name FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "What website, avatar, api_key, language do we have for users and their associated categories?", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, token, display_name, categories.api_key, categories.language FROM e-commerce.users JOIN e-commerce.categories ON users.categorie_id = categories.id;", "sql": null}, {"role": "user", "content": "How many users are there per token?", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM e-commerce.users GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n expires_at date,\n quantity character varying(64),\n views character varying(256),\n popularity_score character varying(128),\n price numeric,\n rating char NOT NULL,\n user_id text NOT NULL -- reference to users.person_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active date,\n avatar character varying(64),\n is_verified boolean -- indicates if verified is true,\n last_login timestamp without time zone,\n api_key character varying(256) NOT NULL,\n language text NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar character varying(64) NOT NULL,\n website character varying(64),\n status char NOT NULL,\n age text,\n display_name character varying(64),\n token character varying(128),\n last_name character varying(128),\n categorie_id text -- reference to categories.id,\n FOREIGN KEY (categorie_id) REFERENCES categories(id)\n)", "conversations": [{"role": "user", "content": "List price, popularity_score, views from products.", "sql": null}, {"role": "assistant", "content": "SELECT price, popularity_score, views FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT price, popularity_score, views FROM e-commerce.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Order the output by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT price, popularity_score, views FROM e-commerce.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get payer_id, approval_status, debit from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, approval_status, debit FROM finance.loans;", "sql": null}, {"role": "user", "content": "Arrange the results with transaction_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, approval_status, debit FROM finance.loans ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Tally up loans by vendor_id.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM finance.loans GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get payment_method, product_id, currency from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, product_id, currency FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by product_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, product_id, currency FROM finance.audits ORDER BY product_id ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of audits across different payment_method values.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM finance.audits GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "List audits with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by loan_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE completed_at > '2023-01-01' ORDER BY loan_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by quantity ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY quantity ASC;", "sql": null}, {"role": "user", "content": "Can you order these by completed_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where loan_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE loan_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE loan_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE completed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of completed_at by quantity from audits.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, AVERAGE(completed_at) AS average_completed_at FROM finance.audits GROUP BY quantity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List due_date, reference_number, payee_id from loans.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, payee_id FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, payee_id FROM finance.loans WHERE due_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, reference_number, payee_id FROM finance.loans WHERE due_date > '2023-12-01' ORDER BY payee_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.audits (\n payment_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n completed_at timestamp,\n payment_method text NOT NULL,\n currency character varying(256),\n product_id character varying(256) -- identifier for product,\n quantity character varying(128) NOT NULL,\n loan_id text -- reference to loans.account_id,\n FOREIGN KEY (loan_id) REFERENCES loans(account_id)\n)\n\nCREATE TABLE finance.payments (\n order_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n traded_at date,\n payment_method text,\n card_type varchar,\n price numeric,\n discount numeric NOT NULL\n)\n\nCREATE TABLE finance.loans (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n debit character varying(128) NOT NULL,\n payee_id character varying(256),\n payer_id varchar -- identifier for payer,\n currency text,\n reference_number varchar,\n vendor_id text -- identifier for vendor,\n approval_status varchar,\n transaction_id text NOT NULL -- reference to transactions.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n status varchar,\n card_type character varying(256),\n delivery_status varchar\n)", "conversations": [{"role": "user", "content": "List product_id, quantity, cancelled_at from audits.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, quantity, cancelled_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Show me audits with completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, quantity, cancelled_at FROM finance.audits WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, quantity, cancelled_at FROM finance.audits WHERE completed_at > '2023-01-01' ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve buyer_id, card_type, status for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, card_type, status FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, card_type, status FROM finance.payments WHERE traded_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by currency ascending?", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, card_type, status FROM finance.payments WHERE traded_at > '2023-12-01' ORDER BY currency ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate average of customer_id for each buyer_id in payments.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, AVERAGE(customer_id) AS average_customer_id FROM finance.payments GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many customers are there per payment_id?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM finance.customers GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments where completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by card_type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE completed_at > '2023-01-01' ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve traded_at, completed_at, amount for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, amount FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, amount FROM finance.payments WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, amount FROM finance.payments WHERE completed_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get sum of salt by full_name from customers.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, SUM(salt) AS sum_salt FROM finance.customers GROUP BY full_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, traded_at, currency for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT status, traded_at, currency FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show the results sorted by customer_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, traded_at, currency FROM finance.payments ORDER BY customer_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, traded_at, currency FROM finance.payments ORDER BY buyer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get age, full_name, birth_date from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT age, full_name, birth_date FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get payment_id, age, currency, customer_id by joining customers with payments.", "sql": null}, {"role": "assistant", "content": "SELECT age, full_name, birth_date, payments.currency, payments.customer_id FROM finance.customers JOIN finance.payments ON customers.payment_id = payments.id;", "sql": null}, {"role": "user", "content": "Group customers by birth_date and show the max of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, MAX(created_at) AS max_created_at FROM finance.customers GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with birth_date in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY birth_date ASC;", "sql": null}, {"role": "user", "content": "Group customers by birth_date and show the sum of age.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, SUM(age) AS sum_age FROM finance.customers GROUP BY birth_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n salt character varying(128) NOT NULL,\n age varchar,\n birth_date timestamp without time zone NOT NULL,\n gender character varying(256),\n full_name text,\n payment_id text NOT NULL -- reference to payments.id,\n FOREIGN KEY (payment_id) REFERENCES payments(id)\n)\n\nCREATE TABLE finance.payments (\n id text PRIMARY KEY -- unique identifier,\n completed_at date,\n traded_at timestamp without time zone,\n card_type text,\n payment_method character varying(128),\n status char,\n buyer_id character varying(64) -- identifier for buyer,\n amount integer NOT NULL,\n currency character varying(128),\n customer_id integer -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)", "conversations": [{"role": "user", "content": "List birth_date, full_name, updated_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, full_name, updated_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by age descending.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, full_name, updated_at FROM finance.customers ORDER BY age DESC;", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM finance.customers GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group messages by image_url and show the min of comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MIN(comment_id) AS min_comment_id FROM socialmedia.messages GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get event_id, edited_at, content from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, edited_at, content FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get messages that match image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, edited_at, content FROM socialmedia.messages WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of messages in each comment_id category.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve content, comment_id, published_at, created_at showing the relationship between messages and events.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.published_at, events.created_at FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku;", "sql": null}, {"role": "user", "content": "Calculate min of edited_at for each comment_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, MIN(edited_at) AS min_edited_at FROM socialmedia.messages GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by content ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages ORDER BY content ASC;", "sql": null}, {"role": "user", "content": "What is the max image_url for each content in messages?", "sql": null}, {"role": "assistant", "content": "SELECT content, MAX(image_url) AS max_image_url FROM socialmedia.messages GROUP BY content;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me image_url, content, comment_id for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, content, comment_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List content, image_url, thumbnail_url, name for each message along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, content, comment_id, events.thumbnail_url, events.name FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, content, comment_id, events.thumbnail_url, events.name FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by content descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY content DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "List edited_at, content, image_url from messages.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, content, image_url FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List event_id, edited_at, video_url, reserved for each message along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, content, image_url, events.video_url, events.reserved FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku;", "sql": null}, {"role": "user", "content": "Arrange the results with content in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, content, image_url, events.video_url, events.reserved FROM socialmedia.messages JOIN socialmedia.events ON messages.event_id = events.sku ORDER BY content DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256),\n content varchar NOT NULL,\n event_id text NOT NULL -- reference to events.sku,\n FOREIGN KEY (event_id) REFERENCES events(sku)\n)\n\nCREATE TABLE socialmedia.events (\n sku text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n price numeric,\n thumbnail_url character varying(256) NOT NULL,\n reserved character varying(256) NOT NULL,\n video_url varchar,\n name character varying(128),\n image_url text\n)\n\nCREATE TABLE socialmedia.comments (\n message_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n likes varchar,\n image_url varchar,\n thumbnail character varying(256) NOT NULL,\n body char,\n user_id text -- identifier for user,\n subject text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get event_id, comment_id, edited_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, comment_id, edited_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, comment_id, edited_at FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me the count of messages grouped by comment_id.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n body char NOT NULL,\n thumbnail character varying(256) NOT NULL,\n media_url character varying(256),\n keywords character varying(64),\n image_url varchar,\n visibility text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.sku,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_method character varying(128),\n currency character varying(64),\n card_type character varying(256) NOT NULL,\n payment_status char,\n delivery_status character varying(64),\n quantity character varying(64),\n exchange_rate character varying(256),\n doctor_id text NOT NULL -- reference to doctors.sku,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n quantity character varying(64),\n thumbnail_url text,\n description character varying(128) NOT NULL,\n available text,\n name character varying(256) NOT NULL,\n discount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me min of doctor_id grouped by card_type for billing.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MIN(doctor_id) AS min_doctor_id FROM healthcare.billing GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n body char NOT NULL,\n thumbnail character varying(256) NOT NULL,\n media_url character varying(256),\n keywords character varying(64),\n image_url varchar,\n visibility text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.sku,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_method character varying(128),\n currency character varying(64),\n card_type character varying(256) NOT NULL,\n payment_status char,\n delivery_status character varying(64),\n quantity character varying(64),\n exchange_rate character varying(256),\n doctor_id text NOT NULL -- reference to doctors.sku,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n quantity character varying(64),\n thumbnail_url text,\n description character varying(128) NOT NULL,\n available text,\n name character varying(256) NOT NULL,\n discount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get count of doctor_id by delivery_status from billing.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(doctor_id) AS count_doctor_id FROM healthcare.billing GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n body char NOT NULL,\n thumbnail character varying(256) NOT NULL,\n media_url character varying(256),\n keywords character varying(64),\n image_url varchar,\n visibility text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.sku,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_method character varying(128),\n currency character varying(64),\n card_type character varying(256) NOT NULL,\n payment_status char,\n delivery_status character varying(64),\n quantity character varying(64),\n exchange_rate character varying(256),\n doctor_id text NOT NULL -- reference to doctors.sku,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n quantity character varying(64),\n thumbnail_url text,\n description character varying(128) NOT NULL,\n available text,\n name character varying(256) NOT NULL,\n discount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List payment_status, currency, card_type from billing.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, currency, card_type FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, currency, card_type FROM healthcare.billing WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, currency, card_type FROM healthcare.billing WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n body char NOT NULL,\n thumbnail character varying(256) NOT NULL,\n media_url character varying(256),\n keywords character varying(64),\n image_url varchar,\n visibility text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.sku,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_method character varying(128),\n currency character varying(64),\n card_type character varying(256) NOT NULL,\n payment_status char,\n delivery_status character varying(64),\n quantity character varying(64),\n exchange_rate character varying(256),\n doctor_id text NOT NULL -- reference to doctors.sku,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n quantity character varying(64),\n thumbnail_url text,\n description character varying(128) NOT NULL,\n available text,\n name character varying(256) NOT NULL,\n discount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by reply_to_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY reply_to_id ASC;", "sql": null}, {"role": "user", "content": "How many appointments are there per image_url?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM healthcare.appointments GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n body char NOT NULL,\n thumbnail character varying(256) NOT NULL,\n media_url character varying(256),\n keywords character varying(64),\n image_url varchar,\n visibility text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.sku,\n billin_id integer -- reference to billing.id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku),\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE healthcare.billing (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payment_method character varying(128),\n currency character varying(64),\n card_type character varying(256) NOT NULL,\n payment_status char,\n delivery_status character varying(64),\n quantity character varying(64),\n exchange_rate character varying(256),\n doctor_id text NOT NULL -- reference to doctors.sku,\n FOREIGN KEY (doctor_id) REFERENCES doctors(sku)\n)\n\nCREATE TABLE healthcare.doctors (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n quantity character varying(64),\n thumbnail_url text,\n description character varying(128) NOT NULL,\n available text,\n name character varying(256) NOT NULL,\n discount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Sort the results by visibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY visibility ASC;", "sql": null}, {"role": "user", "content": "What is the sum visibility for each keywords in appointments?", "sql": null}, {"role": "assistant", "content": "SELECT keywords, SUM(visibility) AS sum_visibility FROM healthcare.appointments GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n customer_id char -- identifier for customer,\n exchange_rate char,\n product_id varchar NOT NULL,\n delivery_status text NOT NULL,\n asset_id text -- reference to assets.product_id,\n metadat_id text NOT NULL -- reference to metadata.employee_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(employee_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n thumbnail_url character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE tradingplatform.metadata (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n birth_date timestamp,\n city varchar,\n bio character varying(256),\n avatar char,\n language char NOT NULL,\n first_name varchar,\n trade_id text -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(128) NOT NULL,\n location_lon varchar NOT NULL,\n zip_code varchar,\n type character varying(128),\n metadat_id text -- reference to metadata.employee_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(employee_id)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by birth_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY birth_date DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY birth_date DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n customer_id char -- identifier for customer,\n exchange_rate char,\n product_id varchar NOT NULL,\n delivery_status text NOT NULL,\n asset_id text -- reference to assets.product_id,\n metadat_id text NOT NULL -- reference to metadata.employee_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (metadat_id) REFERENCES metadata(employee_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp,\n thumbnail_url character varying(256),\n rating character varying(64)\n)\n\nCREATE TABLE tradingplatform.metadata (\n employee_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n birth_date timestamp,\n city varchar,\n bio character varying(256),\n avatar char,\n language char NOT NULL,\n first_name varchar,\n trade_id text -- reference to trades.order_id,\n FOREIGN KEY (trade_id) REFERENCES trades(order_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n parking_available character varying(128) NOT NULL,\n location_lon varchar NOT NULL,\n zip_code varchar,\n type character varying(128),\n metadat_id text -- reference to metadata.employee_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY created_at ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me state, teacher_id, created_at, full_name from students and their related teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.created_at, teachers.full_name FROM education.students JOIN education.teachers ON students.teacher_id = teachers.employee_id;", "sql": null}, {"role": "user", "content": "Arrange the results with full_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.created_at, teachers.full_name FROM education.students JOIN education.teachers ON students.teacher_id = teachers.employee_id ORDER BY full_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get teacher_id, created_at, created_at, website by joining students with teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.created_at, teachers.website FROM education.students JOIN education.teachers ON students.teacher_id = teachers.employee_id;", "sql": null}, {"role": "user", "content": "Calculate min of teacher_id for each created_at in students.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(teacher_id) AS min_teacher_id FROM education.students GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_login >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_login >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Sort the results by website ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY website ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of website for each last_active in teachers.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, SUM(website) AS sum_website FROM education.teachers GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "List completed_at, student_id, amount from grades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, student_id, amount FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, student_id, amount FROM education.grades WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me max of delivery_status grouped by completed_at for grades.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, MAX(delivery_status) AS max_delivery_status FROM education.grades GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE timezone LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me created_at, website, state, teacher_id from teachers and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.state, students.teacher_id FROM education.teachers JOIN education.students ON teachers.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of teachers in each salt category.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM education.teachers GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me exchange_rate, student_id, amount for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, student_id, amount FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, student_id, amount FROM education.grades ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, student_id, amount FROM education.grades ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Can you order these by completed_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "Tally up grades by amount.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM education.grades GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp,\n state character varying(128),\n birth_date timestamp,\n timezone text,\n full_name character varying(256) NOT NULL,\n teacher_id text -- reference to teachers.employee_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(employee_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n exchange_rate varchar NOT NULL,\n delivery_status text,\n payment_status character varying(128),\n amount bigint,\n fee text,\n student_id integer -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.teachers (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n website character varying(256) NOT NULL,\n full_name text NOT NULL,\n last_login timestamp,\n avatar character varying(128) NOT NULL,\n salt char NOT NULL,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)", "conversations": [{"role": "user", "content": "What are the last_active, salt, created_at of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, salt, created_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve student_id, full_name, created_at, full_name showing the relationship between teachers and students.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, salt, created_at, students.created_at, students.full_name FROM education.teachers JOIN education.students ON teachers.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Get count of last_active by avatar from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, COUNT(last_active) AS count_last_active FROM education.teachers GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List updated_at, account_id, transaction_id, joined_at for each transaction along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.transaction_id, customers.joined_at FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.transaction_id, customers.joined_at FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers that have transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE transaction_id LIKE 'A%' ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions ORDER BY customer_id ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, language, transaction_id from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, transaction_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, transaction_id FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, language, transaction_id FROM finance.customers WHERE joined_at > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers with transaction_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE transaction_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE transaction_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, approval_status, customer_id for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, customer_id FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show the results sorted by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, customer_id FROM finance.transactions ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of transactions grouped by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM finance.transactions GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01' ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Get language, joined_at, first_name from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT language, joined_at, first_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT language, joined_at, first_name FROM finance.customers WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT language, joined_at, first_name FROM finance.customers WHERE language LIKE 'A%' ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n exchange_rate character varying(256) NOT NULL,\n approval_status char,\n customer_id integer -- reference to customers.id,\n account_id integer NOT NULL -- reference to accounts.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id),\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)\n\nCREATE TABLE finance.accounts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n due_date timestamp without time zone,\n customer_id varchar,\n status character varying(128),\n category character varying(64),\n reference_number char NOT NULL,\n reconciliation_status character varying(64)\n)\n\nCREATE TABLE finance.customers (\n id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(64),\n language char,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, approval_status, exchange_rate for all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, exchange_rate FROM finance.transactions;", "sql": null}, {"role": "user", "content": "What updated_at, exchange_rate, language, transaction_id do we have for transactions and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, exchange_rate, customers.language, customers.transaction_id FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, approval_status, exchange_rate, customers.language, customers.transaction_id FROM finance.transactions JOIN finance.customers ON transactions.customer_id = customers.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get users that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE joined_at > '2023-01-01' ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List joined_at, profile_picture_url, employee_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, profile_picture_url, employee_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Arrange the results with employee_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, profile_picture_url, employee_id FROM e-commerce.users ORDER BY employee_id ASC;", "sql": null}, {"role": "user", "content": "Calculate count of joined_at for each language in users.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(joined_at) AS count_joined_at FROM e-commerce.users GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me product_id, card_type, completed_at for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, card_type, completed_at FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, card_type, completed_at FROM e-commerce.orders WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by card_type descending?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, card_type, completed_at FROM e-commerce.orders WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by gender ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY gender ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Find orders created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE cancelled_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Show me orders with card_type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE card_type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders WHERE card_type LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the employee_id, profile_picture_url, language of each user?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, profile_picture_url, language FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, profile_picture_url, language FROM e-commerce.users WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me max of profile_picture_url grouped by gender for users.", "sql": null}, {"role": "assistant", "content": "SELECT gender, MAX(profile_picture_url) AS max_profile_picture_url FROM e-commerce.users GROUP BY gender;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Arrange the results with card_type in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY card_type ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY card_type ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "Sort the results by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders ORDER BY completed_at ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n transaction_id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n cancelled_at date,\n quantity char,\n payment_status character varying(256),\n discount numeric,\n card_type text NOT NULL,\n approval_status character varying(64),\n product_id character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp without time zone,\n gender character varying(128),\n language character varying(256),\n profile_picture_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE employee_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of patients across different joined_at values.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.patients GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Show me doctor_id, customer_id, full_name for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, customer_id, full_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Sort the results by full_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, customer_id, full_name FROM healthcare.patients ORDER BY full_name DESC;", "sql": null}, {"role": "user", "content": "Sort the results by api_key descending.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, customer_id, full_name FROM healthcare.patients ORDER BY api_key DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Order the output by joined_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY joined_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Get api_key, avatar, doctor_id from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, avatar, doctor_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, avatar, doctor_id FROM healthcare.patients WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by doctor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, avatar, doctor_id FROM healthcare.patients WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY doctor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "List api_key, customer_id, doctor_id from patients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, customer_id, doctor_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, customer_id, doctor_id FROM healthcare.patients WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the count full_name for each api_key in patients?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(full_name) AS count_full_name FROM healthcare.patients GROUP BY api_key;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE customer_id LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Show me api_key, joined_at, avatar for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, joined_at, avatar FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, joined_at, avatar FROM healthcare.patients WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up patients by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM healthcare.patients GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n completed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL,\n card_type text NOT NULL,\n user_id character varying(256) NOT NULL,\n buyer_id text -- identifier for buyer\n)\n\nCREATE TABLE healthcare.prescriptions (\n venue_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp without time zone,\n description char NOT NULL,\n coordinates character varying(128),\n parking_available text\n)\n\nCREATE TABLE healthcare.doctors (\n location_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(64) NOT NULL,\n coordinates character varying(128),\n type text NOT NULL,\n longitude character varying(128),\n address_line2 varchar NOT NULL,\n city character varying(64)\n)\n\nCREATE TABLE healthcare.patients (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp without time zone,\n full_name character varying(256),\n avatar character varying(64),\n api_key character varying(128),\n doctor_id integer -- reference to doctors.location_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me created_at, customer_id, coordinates, category from patients and their related doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.coordinates, doctors.category FROM healthcare.patients JOIN healthcare.doctors ON patients.doctor_id = doctors.location_id;", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by doctor_id.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.patients GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me groups that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by token descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY token DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, like_id, quantity, popularity_score showing the relationship between groups and likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.quantity, likes.popularity_score FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Calculate sum of like_id for each gender in groups.", "sql": null}, {"role": "assistant", "content": "SELECT gender, SUM(like_id) AS sum_like_id FROM socialmedia.groups GROUP BY gender;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve like_id, token, reserved, quantity showing the relationship between groups and likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.reserved, likes.quantity FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Count the number of groups in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.groups GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List groups with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the max token for each like_id in groups?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, MAX(token) AS max_token FROM socialmedia.groups GROUP BY like_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Get token, customer_id, created_at from all groups.", "sql": null}, {"role": "assistant", "content": "SELECT token, customer_id, created_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get groups that match customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT token, customer_id, created_at FROM socialmedia.groups WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by bio descending?", "sql": null}, {"role": "assistant", "content": "SELECT token, customer_id, created_at FROM socialmedia.groups WHERE customer_id LIKE 'A%' ORDER BY bio DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve bio, like_id, customer_id for every group.", "sql": null}, {"role": "assistant", "content": "SELECT bio, like_id, customer_id FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get customer_id, created_at, reserved, updated_at by joining groups with likes.", "sql": null}, {"role": "assistant", "content": "SELECT bio, like_id, customer_id, likes.reserved, likes.updated_at FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Show me the count of groups grouped by bio.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM socialmedia.groups GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get groups that match like_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE like_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE like_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Find groups where gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many groups are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM socialmedia.groups GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me customer_id, bio, quantity, updated_at from groups and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.quantity, likes.updated_at FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.quantity, likes.updated_at FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.likes (\n product_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n reserved character varying(128),\n popularity_score char,\n quantity character varying(256)\n)\n\nCREATE TABLE socialmedia.groups (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n token char,\n bio character varying(64),\n gender text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve groups where customer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE customer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by gender descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups WHERE customer_id LIKE 'A%' ORDER BY gender DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "List user_id, customer_id, traded_at from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, customer_id, traded_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, customer_id, traded_at FROM education.enrollments WHERE traded_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get the distribution of enrollments across different course_id values.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, COUNT(*) AS count FROM education.enrollments GROUP BY course_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me max of status grouped by customer_id for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(status) AS max_status FROM education.enrollments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Get user_id, traded_at, customer_id from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, customer_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, traded_at, customer_id FROM education.enrollments WHERE traded_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the sum status for each course_id in enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT course_id, SUM(status) AS sum_status FROM education.enrollments GROUP BY course_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "List exchange_rate, course_id, traded_at from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, course_id, traded_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Can you order these by course_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, course_id, traded_at FROM education.enrollments ORDER BY course_id DESC;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate ascending?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, course_id, traded_at FROM education.enrollments ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Get course_id, customer_id, exchange_rate from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, customer_id, exchange_rate FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, customer_id, exchange_rate FROM education.enrollments WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of exchange_rate grouped by customer_id for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, SUM(exchange_rate) AS sum_exchange_rate FROM education.enrollments GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Find enrollments between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE traded_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the sum exchange_rate for each user_id in enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(exchange_rate) AS sum_exchange_rate FROM education.enrollments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by course_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments ORDER BY course_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me courses with operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE operating_hours LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Order the output by operating_hours ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY operating_hours ASC;", "sql": null}, {"role": "user", "content": "Tally up courses by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM education.courses GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp,\n geo_point varchar NOT NULL,\n postal_code text,\n name character varying(256),\n location_lat character varying(64),\n operating_hours text NOT NULL,\n coordinates text,\n department_id integer NOT NULL -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)\n\nCREATE TABLE education.departments (\n payment_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n payer_id character varying(128),\n invoice_number character varying(64),\n payee_id varchar NOT NULL -- identifier for payee,\n amount decimal NOT NULL,\n category text NOT NULL,\n reference_number character varying(256) NOT NULL\n)\n\nCREATE TABLE education.enrollments (\n order_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n user_id character varying(64) NOT NULL -- identifier for user,\n exchange_rate character varying(128),\n customer_id text,\n status character varying(256),\n course_id text -- reference to courses.venue_id,\n FOREIGN KEY (course_id) REFERENCES courses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get operating_hours, created_at, reference_number, amount by joining courses with departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.reference_number, departments.amount FROM education.courses JOIN education.departments ON courses.department_id = departments.payment_id;", "sql": null}, {"role": "user", "content": "Get the distribution of courses across different coordinates values.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, COUNT(*) AS count FROM education.courses GROUP BY coordinates ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me last_login, appointment_id, created_at for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, appointment_id, created_at FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, appointment_id, created_at FROM healthcare.patients WHERE last_login >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me sum of zip_code grouped by user_id for patients.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(zip_code) AS sum_zip_code FROM healthcare.patients GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve last_login, age, balance, reconciliation_status showing the relationship between patients and appointments.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.balance, appointments.reconciliation_status FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.payment_id;", "sql": null}, {"role": "user", "content": "Sort the results by last_login ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.balance, appointments.reconciliation_status FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.payment_id ORDER BY last_login ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "How many patients are there per last_login?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, COUNT(*) AS count FROM healthcare.patients GROUP BY last_login ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Get created_at, last_name, age from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_name, age FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_name, age FROM healthcare.patients WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_name, age FROM healthcare.patients WHERE user_id LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "What zip_code, last_name, balance, credit do we have for patients and their associated appointments?", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.balance, appointments.credit FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.payment_id;", "sql": null}, {"role": "user", "content": "Group patients by last_name and show the average of age.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, AVERAGE(age) AS average_age FROM healthcare.patients GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match age LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE age LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE age LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the age, zip_code, last_name of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, last_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Sort the results by last_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, last_name FROM healthcare.patients ORDER BY last_name DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT age, zip_code, last_name FROM healthcare.patients ORDER BY last_name DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match appointment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE appointment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by zip_code ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE appointment_id LIKE 'A%' ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate count of age for each created_at in patients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(age) AS count_age FROM healthcare.patients GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n last_name varchar,\n age varchar,\n last_login timestamp,\n zip_code text NOT NULL,\n avatar char NOT NULL,\n appointment_id text -- reference to appointments.payment_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(payment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n notes char,\n balance decimal,\n category varchar,\n reconciliation_status varchar NOT NULL,\n credit character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by appointment_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY appointment_id DESC;", "sql": null}, {"role": "user", "content": "Get sum of created_at by age from patients.", "sql": null}, {"role": "assistant", "content": "SELECT age, SUM(created_at) AS sum_created_at FROM healthcare.patients GROUP BY age;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Order the output by log_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY log_id ASC;", "sql": null}, {"role": "user", "content": "Show me count of order_id grouped by notification_id for trades.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, COUNT(order_id) AS count_order_id FROM tradingplatform.trades GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get vendor_id, updated_at, notification_id from all logs.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, updated_at, notification_id FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve logs where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, updated_at, notification_id FROM tradingplatform.logs WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, updated_at, notification_id FROM tradingplatform.logs WHERE user_id LIKE 'A%' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List payer_id, approval_status, price, rating for each log along with their notification information.", "sql": null}, {"role": "assistant", "content": "SELECT *, notifications.price, notifications.rating FROM tradingplatform.logs JOIN tradingplatform.notifications ON logs.notification_id = notifications.barcode;", "sql": null}, {"role": "user", "content": "Sort the results by payee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, notifications.price, notifications.rating FROM tradingplatform.logs JOIN tradingplatform.notifications ON logs.notification_id = notifications.barcode ORDER BY payee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve trades where log_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE log_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE log_id LIKE 'A%' ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "List customer_id, updated_at, delivery_status from trades.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, delivery_status FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Order the output by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, delivery_status FROM tradingplatform.trades ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "How many trades are there per log_id?", "sql": null}, {"role": "assistant", "content": "SELECT log_id, COUNT(*) AS count FROM tradingplatform.trades GROUP BY log_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get vendor_id, payer_id, user_id from all logs.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, payer_id, user_id FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs where payer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, payer_id, user_id FROM tradingplatform.logs WHERE payer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of user_id for each notification_id in logs.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, COUNT(user_id) AS count_user_id FROM tradingplatform.logs GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get updated_at, log_id, price, reserved by joining trades with notifications.", "sql": null}, {"role": "assistant", "content": "SELECT *, notifications.price, notifications.reserved FROM tradingplatform.trades JOIN tradingplatform.notifications ON trades.notification_id = notifications.barcode;", "sql": null}, {"role": "user", "content": "Show me the count of trades grouped by customer_id.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM tradingplatform.trades GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Get average of buyer_id by log_id from trades.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, AVERAGE(buyer_id) AS average_buyer_id FROM tradingplatform.trades GROUP BY log_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me customer_id, updated_at, order_id for all trades.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, order_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Get all trades created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, order_id FROM tradingplatform.trades WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, updated_at, order_id FROM tradingplatform.trades WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n user_id varchar,\n payee_id text -- identifier for payee,\n approval_status char,\n payer_id text NOT NULL -- identifier for payer,\n vendor_id text -- identifier for vendor,\n notification_id integer NOT NULL -- reference to notifications.barcode,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode)\n)\n\nCREATE TABLE tradingplatform.notifications (\n barcode integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n reserved text NOT NULL,\n thumbnail_url character varying(128),\n price numeric(38,14),\n rating char\n)\n\nCREATE TABLE tradingplatform.trades (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n buyer_id character varying(128) NOT NULL -- identifier for buyer,\n delivery_status character varying(64) NOT NULL,\n customer_id text,\n notification_id integer -- reference to notifications.barcode,\n log_id text -- reference to logs.invoice_id,\n FOREIGN KEY (notification_id) REFERENCES notifications(barcode),\n FOREIGN KEY (log_id) REFERENCES logs(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me vendor_id, payee_id, approval_status for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, payee_id, approval_status FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List updated_at, notification_id, price, thumbnail_url for each log along with their notification information.", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, payee_id, approval_status, notifications.price, notifications.thumbnail_url FROM tradingplatform.logs JOIN tradingplatform.notifications ON logs.notification_id = notifications.barcode;", "sql": null}, {"role": "user", "content": "How many logs are there per vendor_id?", "sql": null}, {"role": "assistant", "content": "SELECT vendor_id, COUNT(*) AS count FROM tradingplatform.logs GROUP BY vendor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.inventory;", "sql": null}, {"role": "user", "content": "Order the output by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.inventory ORDER BY available DESC;", "sql": null}, {"role": "user", "content": "Group inventory by published_at and show the sum of available.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, SUM(available) AS sum_available FROM retail.inventory GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Retrieve city, is_active, country for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT city, is_active, country FROM retail.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT city, is_active, country FROM retail.patients WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of patients across different city values.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(*) AS count FROM retail.patients GROUP BY city ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "List full_name, country, created_at from patients.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, country, created_at FROM retail.patients;", "sql": null}, {"role": "user", "content": "List patients that have country LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, country, created_at FROM retail.patients WHERE country LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of created_at grouped by city for patients.", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(created_at) AS count_created_at FROM retail.patients GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "What are the is_active, created_at, city of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, created_at, city FROM retail.patients;", "sql": null}, {"role": "user", "content": "Can you order these by is_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, created_at, city FROM retail.patients ORDER BY is_active ASC;", "sql": null}, {"role": "user", "content": "Group patients by created_at and show the count of city.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(city) AS count_city FROM retail.patients GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Show me published_at, popularity_score, subcategory for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, popularity_score, subcategory FROM retail.inventory;", "sql": null}, {"role": "user", "content": "List inventory with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, popularity_score, subcategory FROM retail.inventory WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, popularity_score, subcategory FROM retail.inventory WHERE created_at > '2023-12-01' ORDER BY available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients;", "sql": null}, {"role": "user", "content": "Find patients between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "What is the count country for each city in patients?", "sql": null}, {"role": "assistant", "content": "SELECT city, COUNT(country) AS count_country FROM retail.patients GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "What are the city, full_name, country of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT city, full_name, country FROM retail.patients;", "sql": null}, {"role": "user", "content": "Get all patients older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT city, full_name, country FROM retail.patients WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate sum of full_name for each full_name in patients.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, SUM(full_name) AS sum_full_name FROM retail.patients GROUP BY full_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Get created_at, is_active, full_name from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, is_active, full_name FROM retail.patients;", "sql": null}, {"role": "user", "content": "Get all patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, is_active, full_name FROM retail.patients WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of patients in each full_name category.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM retail.patients GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients;", "sql": null}, {"role": "user", "content": "Can you order these by is_active ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients ORDER BY is_active ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients ORDER BY is_active ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n city character varying(64),\n is_active boolean NOT NULL,\n country character varying(64) NOT NULL,\n full_name char\n)\n\nCREATE TABLE retail.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp,\n video_url varchar,\n tax_rate character varying(256) NOT NULL,\n popularity_score char,\n available varchar,\n subcategory text,\n views char\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients;", "sql": null}, {"role": "user", "content": "Show me patients with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with city in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.patients WHERE created_at > '2023-01-01' ORDER BY city DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List discount, rating, expires_at from products.", "sql": null}, {"role": "assistant", "content": "SELECT discount, rating, expires_at FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT discount, rating, expires_at FROM restaurant.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by item_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT discount, rating, expires_at FROM restaurant.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY item_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "List products with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Can you order these by backorder ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Tally up products by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM restaurant.products GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "List quantity, name, created_at, debit for each product along with their finance information.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.created_at, finances.debit FROM restaurant.products JOIN restaurant.finances ON products.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, finances.created_at, finances.debit FROM restaurant.products JOIN restaurant.finances ON products.finance_id = finances.account_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Find products created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me item_id, finance_id, rating for all products.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, finance_id, rating FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Get video_url, finance_id, debit, currency by joining products with finances.", "sql": null}, {"role": "assistant", "content": "SELECT item_id, finance_id, rating, finances.debit, finances.currency FROM restaurant.products JOIN restaurant.finances ON products.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "How many products are there per backorder?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM restaurant.products GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Show me products that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Retrieve products where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by video_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.products WHERE rating LIKE 'A%' ORDER BY video_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get finance_id, backorder, quantity from all products.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, backorder, quantity FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Get backorder, video_url, created_at, vendor_id by joining products with finances.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, backorder, quantity, finances.created_at, finances.vendor_id FROM restaurant.products JOIN restaurant.finances ON products.finance_id = finances.account_id;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT finance_id, backorder, quantity, finances.created_at, finances.vendor_id FROM restaurant.products JOIN restaurant.finances ON products.finance_id = finances.account_id ORDER BY quantity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.products (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n expires_at timestamp without time zone,\n backorder character varying(128),\n available text NOT NULL,\n rating character varying(256) NOT NULL,\n discount decimal NOT NULL,\n name character varying(256),\n quantity character varying(64),\n video_url character varying(128) NOT NULL -- identifier for video_url,\n finance_id text -- reference to finances.account_id,\n FOREIGN KEY (finance_id) REFERENCES finances(account_id)\n)\n\nCREATE TABLE restaurant.finances (\n account_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_date timestamp,\n category char NOT NULL,\n debit character varying(128) NOT NULL,\n vendor_id text NOT NULL,\n payee_id character varying(256),\n verification_status character varying(256),\n currency varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get expires_at, discount, finance_id from all products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, discount, finance_id FROM restaurant.products;", "sql": null}, {"role": "user", "content": "Show me products that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, discount, finance_id FROM restaurant.products WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM restaurant.products GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get users that match timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by inventor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE timezone LIKE 'A%' ORDER BY inventor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE popularity_score LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "What are the timezone, last_active, account_status of each user?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_active, account_status FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me account_status, last_active, featured_rank, tax_rate from users and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, last_active, account_status, inventory.featured_rank, inventory.tax_rate FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.sku;", "sql": null}, {"role": "user", "content": "Get sum of last_active by timezone from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, SUM(last_active) AS sum_last_active FROM e-commerce.users GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Get timezone, account_status, inventor_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_status, inventor_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_status, inventor_id FROM e-commerce.users WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_status, inventor_id FROM e-commerce.users WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up users by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.users GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY created_at ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Show me account_status, last_active, age for all users.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, last_active, age FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT account_status, last_active, age FROM e-commerce.users ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Order the output by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, last_active, age FROM e-commerce.users ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve inventory where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate min of popularity_score for each thumbnail_url in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, MIN(popularity_score) AS min_popularity_score FROM e-commerce.inventory GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "List thumbnail_url, published_at, user_id from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, published_at, user_id FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Retrieve inventory where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, published_at, user_id FROM e-commerce.inventory WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get max of popularity_score by published_at from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, MAX(popularity_score) AS max_popularity_score FROM e-commerce.inventory GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n sku integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n tax_rate char,\n currency text NOT NULL,\n featured_rank char,\n thumbnail_url char,\n popularity_score varchar NOT NULL,\n cost decimal,\n user_id integer NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_active date,\n age varchar,\n account_status character varying(128) NOT NULL,\n timezone character varying(128),\n inventor_id integer NOT NULL -- reference to inventory.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve account_status, age, timezone for every user.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, age, timezone FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, age, timezone FROM e-commerce.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Sort the results by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, age, timezone FROM e-commerce.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day' ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments where operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE operating_hours LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Show me investments with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE description LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "List description, category, created_at from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, created_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What category, created_at, account_id, last_inspected do we have for accounts and their associated investments?", "sql": null}, {"role": "assistant", "content": "SELECT description, category, created_at, investments.account_id, investments.last_inspected FROM finance.accounts JOIN finance.investments ON accounts.investment_id = investments.location_id;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT description, category, created_at, investments.account_id, investments.last_inspected FROM finance.accounts JOIN finance.investments ON accounts.investment_id = investments.location_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "List investments that have operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by operating_hours descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE operating_hours LIKE 'A%' ORDER BY operating_hours DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payment_date DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY payment_date DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get category, description, payment_date from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT category, description, payment_date FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get created_at, payment_date, last_inspected, postal_code by joining accounts with investments.", "sql": null}, {"role": "assistant", "content": "SELECT category, description, payment_date, investments.last_inspected, investments.postal_code FROM finance.accounts JOIN finance.investments ON accounts.investment_id = investments.location_id;", "sql": null}, {"role": "user", "content": "Show me average of invoice_number grouped by investment_id for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, AVERAGE(invoice_number) AS average_invoice_number FROM finance.accounts GROUP BY investment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the category, created_at, investment_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT category, created_at, investment_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Order the output by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT category, created_at, investment_id FROM finance.accounts ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Show me the count of accounts grouped by investment_id.", "sql": null}, {"role": "assistant", "content": "SELECT investment_id, COUNT(*) AS count FROM finance.accounts GROUP BY investment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Get investments that match last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate count of description for each postal_code in investments.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, COUNT(description) AS count_description FROM finance.investments GROUP BY postal_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all investments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.investments;", "sql": null}, {"role": "user", "content": "Retrieve description, updated_at, payment_date, investment_id showing the relationship between investments and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.payment_date, accounts.investment_id FROM finance.investments JOIN finance.accounts ON investments.account_id = accounts.transaction_id;", "sql": null}, {"role": "user", "content": "Tally up investments by parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM finance.investments GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n payment_date date,\n invoice_number character varying(256),\n description text NOT NULL,\n category text,\n investment_id integer NOT NULL -- reference to investments.location_id,\n FOREIGN KEY (investment_id) REFERENCES investments(location_id)\n)\n\nCREATE TABLE finance.payments (\n order_id integer PRIMARY KEY -- unique identifier,\n processed_at date,\n delivery_status char,\n approval_status text,\n quantity character varying(128) NOT NULL\n)\n\nCREATE TABLE finance.investments (\n location_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n postal_code varchar NOT NULL,\n parking_available character varying(64) NOT NULL,\n description text NOT NULL,\n operating_hours character varying(256),\n account_id text NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me operating_hours, description, account_id for all investments.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, description, account_id FROM finance.investments;", "sql": null}, {"role": "user", "content": "Find investments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, description, account_id FROM finance.investments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate count of last_inspected for each postal_code in investments.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, COUNT(last_inspected) AS count_last_inspected FROM finance.investments GROUP BY postal_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve token, joined_at, first_name for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT token, joined_at, first_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT token, joined_at, first_name FROM finance.customers WHERE birth_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by password_hash.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM finance.customers GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-01-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get first_name, token, joined_at from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, token, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, token, joined_at FROM finance.customers WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count joined_at for each joined_at in customers?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(joined_at) AS count_joined_at FROM finance.customers GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, token, password_hash from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, token, password_hash FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, token, password_hash FROM finance.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by investment_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, token, password_hash FROM finance.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY investment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up customers by birth_date.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, COUNT(*) AS count FROM finance.customers GROUP BY birth_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get is_active, birth_date, investment_id from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, birth_date, investment_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me first_name, token, amount, debit from customers and their related investments.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, birth_date, investment_id, investments.amount, investments.debit FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.invoice_id;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, birth_date, investment_id, investments.amount, investments.debit FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.invoice_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List investment_id, token, customer_id, debit for each customer along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.customer_id, investments.debit FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.invoice_id;", "sql": null}, {"role": "user", "content": "What is the average token for each first_name in customers?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, AVERAGE(token) AS average_token FROM finance.customers GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List investment_id, first_name, processed_at, balance for each customer along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.processed_at, investments.balance FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.invoice_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.processed_at, investments.balance FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.invoice_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE birth_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of birth_date for each token in customers.", "sql": null}, {"role": "assistant", "content": "SELECT token, MIN(birth_date) AS min_birth_date FROM finance.customers GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at date,\n processed_at timestamp without time zone,\n customer_id text,\n exchange_rate character varying(256),\n verification_status character varying(64),\n amount decimal NOT NULL,\n debit character varying(128) NOT NULL,\n balance decimal\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n password_hash character varying(256),\n token text NOT NULL,\n first_name character varying(256),\n birth_date timestamp without time zone,\n is_active bit -- indicates if active is true,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get birth_date, joined_at, token from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, joined_at, token FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by is_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, joined_at, token FROM finance.customers ORDER BY is_active ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, joined_at, token FROM finance.customers ORDER BY is_active ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get orders that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by card_type descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE status LIKE 'A%' ORDER BY card_type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Get status, account_id, currency from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT status, account_id, currency FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Can you order these by status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT status, account_id, currency FROM tradingplatform.orders ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Count the number of orders in each account_id category.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get exchange_rate, traded_at, subject, created_at by joining orders with logs.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.subject, logs.created_at FROM tradingplatform.orders JOIN tradingplatform.logs ON orders.log_id = logs.content_id;", "sql": null}, {"role": "user", "content": "Get count of id by log_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, COUNT(id) AS count_id FROM tradingplatform.orders GROUP BY log_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different currency values.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM tradingplatform.orders GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "What card_type, exchange_rate, subject, keywords do we have for orders and their associated logs?", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.subject, logs.keywords FROM tradingplatform.orders JOIN tradingplatform.logs ON orders.log_id = logs.content_id;", "sql": null}, {"role": "user", "content": "What is the average card_type for each account_id in orders?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, AVERAGE(card_type) AS average_card_type FROM tradingplatform.orders GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "List log_id, id, status from orders.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, id, status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders where account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT log_id, id, status FROM tradingplatform.orders WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different id values.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "List id, traded_at, exchange_rate from orders.", "sql": null}, {"role": "assistant", "content": "SELECT id, traded_at, exchange_rate FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get all orders created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT id, traded_at, exchange_rate FROM tradingplatform.orders WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by card_type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT id, traded_at, exchange_rate FROM tradingplatform.orders WHERE cancelled_at > '2023-12-01' ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up orders by account_id.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM tradingplatform.orders GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve log_id, id, subject, created_at showing the relationship between orders and logs.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.subject, logs.created_at FROM tradingplatform.orders JOIN tradingplatform.logs ON orders.log_id = logs.content_id;", "sql": null}, {"role": "user", "content": "Sort the results by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.subject, logs.created_at FROM tradingplatform.orders JOIN tradingplatform.logs ON orders.log_id = logs.content_id ORDER BY account_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n cancelled_at date,\n currency character varying(64),\n status character varying(128),\n exchange_rate character varying(256),\n account_id text NOT NULL -- identifier for account,\n card_type character varying(64),\n log_id text -- reference to logs.content_id,\n FOREIGN KEY (log_id) REFERENCES logs(content_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n keywords char,\n author_id character varying(64) NOT NULL,\n subject text\n)", "conversations": [{"role": "user", "content": "List cancelled_at, account_id, log_id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, account_id, log_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, account_id, log_id FROM tradingplatform.orders ORDER BY account_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of orders in each exchange_rate category.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM tradingplatform.orders GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve trades where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get country, full_name, order_id, price by joining users with trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.order_id, trades.price FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "Count the number of users in each country category.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM tradingplatform.users GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me full_name, trade_id, buyer_id, price from users and their related trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.buyer_id, trades.price FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "List user_id, order_id, exchange_rate from trades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, order_id, exchange_rate FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, order_id, exchange_rate FROM tradingplatform.trades WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, order_id, exchange_rate FROM tradingplatform.trades WHERE exchange_rate LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Can you order these by country descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Tally up users by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM tradingplatform.users GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_name, country, membership_level for every user.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, country, membership_level FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users that have trade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_name, country, membership_level FROM tradingplatform.users WHERE trade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count is_active for each last_name in users?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, COUNT(is_active) AS count_is_active FROM tradingplatform.users GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n discount integer,\n amount numeric,\n subtotal numeric,\n customer_id character varying(128) NOT NULL,\n exchange_rate text,\n seller_id character varying(128) -- identifier for seller,\n user_id character varying(64) -- identifier for user,\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n exchange_rate varchar,\n buyer_id character varying(256) -- identifier for buyer,\n price numeric,\n user_id text NOT NULL -- reference to users.person_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(person_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE tradingplatform.users (\n person_id varchar PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n full_name character varying(256),\n membership_level character varying(128),\n country character varying(128),\n is_active bit -- indicates if active is true,\n last_name character varying(256),\n trade_id text -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get trade_id, joined_at, user_id, buyer_id by joining users with trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.user_id, trades.buyer_id FROM tradingplatform.users JOIN tradingplatform.trades ON users.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "Count the number of users in each membership_level category.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, COUNT(*) AS count FROM tradingplatform.users GROUP BY membership_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the name, discount, cost of each product?", "sql": null}, {"role": "assistant", "content": "SELECT name, discount, cost FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What views, discount, country, birth_date do we have for products and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT name, discount, cost, shipping.country, shipping.birth_date FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT name, discount, cost, shipping.country, shipping.birth_date FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY expires_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many products are there per discount?", "sql": null}, {"role": "assistant", "content": "SELECT discount, COUNT(*) AS count FROM e-commerce.products GROUP BY discount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by discount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY discount ASC;", "sql": null}, {"role": "user", "content": "Count the number of products in each name category.", "sql": null}, {"role": "assistant", "content": "SELECT name, COUNT(*) AS count FROM e-commerce.products GROUP BY name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Get discount, backorder, cost from all products.", "sql": null}, {"role": "assistant", "content": "SELECT discount, backorder, cost FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What views, discount, age, nationality do we have for products and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT discount, backorder, cost, shipping.age, shipping.nationality FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id;", "sql": null}, {"role": "user", "content": "Can you order these by expires_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT discount, backorder, cost, shipping.age, shipping.nationality FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Get manufacturer, expires_at, discount from all products.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, expires_at, discount FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What created_at, backorder, age, nationality do we have for products and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, expires_at, discount, shipping.age, shipping.nationality FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id;", "sql": null}, {"role": "user", "content": "Count the number of products in each views category.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM e-commerce.products GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by backorder.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM e-commerce.products GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve name, created_at, country, age showing the relationship between products and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.country, shipping.age FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.country, shipping.age FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n expires_at timestamp,\n views text NOT NULL,\n manufacturer character varying(64),\n name character varying(256),\n discount numeric,\n backorder text NOT NULL,\n cost bigint,\n shippin_id text -- reference to shipping.id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(id)\n)\n\nCREATE TABLE e-commerce.shipping (\n id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n last_active date,\n age text,\n country character varying(64),\n birth_date timestamp without time zone,\n nationality character varying(64)\n)", "conversations": [{"role": "user", "content": "Get shippin_id, backorder, views from all products.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, backorder, views FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by cost descending?", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, backorder, views FROM e-commerce.products ORDER BY cost DESC;", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.products GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me website, trade_id, seller_id, completed_at from logs and their related trades.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.seller_id, trades.completed_at FROM tradingplatform.logs JOIN tradingplatform.trades ON logs.trade_id = trades.payment_id;", "sql": null}, {"role": "user", "content": "Get the distribution of logs across different address values.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM tradingplatform.logs GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "What is_active, trade_id, user_id, discount do we have for logs and their associated trades?", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.user_id, trades.discount FROM tradingplatform.logs JOIN tradingplatform.trades ON logs.trade_id = trades.payment_id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, trades.user_id, trades.discount FROM tradingplatform.logs JOIN tradingplatform.trades ON logs.trade_id = trades.payment_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs with last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of logs grouped by address.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM tradingplatform.logs GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the is_active, is_verified, email of each log?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, email FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show the results sorted by is_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, email FROM tradingplatform.logs ORDER BY is_active ASC;", "sql": null}, {"role": "user", "content": "Show me the count of logs grouped by is_verified.", "sql": null}, {"role": "assistant", "content": "SELECT is_verified, COUNT(*) AS count FROM tradingplatform.logs GROUP BY is_verified ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me website, token, is_active for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT website, token, is_active FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT website, token, is_active FROM tradingplatform.logs ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Group logs by is_active and show the min of token.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, MIN(token) AS min_token FROM tradingplatform.logs GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "Get is_active, is_verified, website from all logs.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, website FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Can you order these by trade_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, is_verified, website FROM tradingplatform.logs ORDER BY trade_id DESC;", "sql": null}, {"role": "user", "content": "What is the count token for each token in logs?", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(token) AS count_token FROM tradingplatform.logs GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many logs are there per token?", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM tradingplatform.logs GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up logs by token.", "sql": null}, {"role": "assistant", "content": "SELECT token, COUNT(*) AS count FROM tradingplatform.logs GROUP BY token ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the token, is_verified, last_active of each log?", "sql": null}, {"role": "assistant", "content": "SELECT token, is_verified, last_active FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve token, updated_at, customer_id, seller_id showing the relationship between logs and trades.", "sql": null}, {"role": "assistant", "content": "SELECT token, is_verified, last_active, trades.customer_id, trades.seller_id FROM tradingplatform.logs JOIN tradingplatform.trades ON logs.trade_id = trades.payment_id;", "sql": null}, {"role": "user", "content": "Get max of email by token from logs.", "sql": null}, {"role": "assistant", "content": "SELECT token, MAX(email) AS max_email FROM tradingplatform.logs GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.logs (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp without time zone,\n email text,\n token char,\n website character varying(64),\n is_verified boolean,\n is_active boolean NOT NULL -- indicates if active is true,\n address character varying(128),\n trade_id text NOT NULL -- reference to trades.payment_id,\n FOREIGN KEY (trade_id) REFERENCES trades(payment_id)\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n card_type character varying(256),\n user_id character varying(256) -- identifier for user,\n approval_status character varying(128),\n customer_id text -- identifier for customer,\n seller_id character varying(64),\n discount smallint\n)\n\nCREATE TABLE tradingplatform.metadata (\n location_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n address_line2 varchar,\n location_lat character varying(256),\n state text,\n parking_available char NOT NULL\n)", "conversations": [{"role": "user", "content": "List is_active, updated_at, email from logs.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, updated_at, email FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List logs with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, updated_at, email FROM tradingplatform.logs WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, updated_at, email FROM tradingplatform.logs WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n email char,\n api_key character varying(64),\n gender text,\n display_name character varying(256),\n salt char,\n first_name character varying(64),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n subject text,\n user_id character varying(128),\n image_url character varying(64),\n body text,\n attachment_url text\n)\n\nCREATE TABLE healthcare.departments (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n api_key char,\n address char,\n status text,\n username char,\n city character varying(128),\n membership_level character varying(128),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n longitude varchar NOT NULL,\n capacity character varying(128) NOT NULL,\n address_line1 character varying(128),\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many billing are there per gender?", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM healthcare.billing GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n email char,\n api_key character varying(64),\n gender text,\n display_name character varying(256),\n salt char,\n first_name character varying(64),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n subject text,\n user_id character varying(128),\n image_url character varying(64),\n body text,\n attachment_url text\n)\n\nCREATE TABLE healthcare.departments (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n api_key char,\n address char,\n status text,\n username char,\n city character varying(128),\n membership_level character varying(128),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n longitude varchar NOT NULL,\n capacity character varying(128) NOT NULL,\n address_line1 character varying(128),\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE gender LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n email char,\n api_key character varying(64),\n gender text,\n display_name character varying(256),\n salt char,\n first_name character varying(64),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.medical_records (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n subject text,\n user_id character varying(128),\n image_url character varying(64),\n body text,\n attachment_url text\n)\n\nCREATE TABLE healthcare.departments (\n customer_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at date,\n api_key char,\n address char,\n status text,\n username char,\n city character varying(128),\n membership_level character varying(128),\n medical_record_id text -- reference to medical_records.comment_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(comment_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n longitude varchar NOT NULL,\n capacity character varying(128) NOT NULL,\n address_line1 character varying(128),\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Arrange the results with longitude in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY longitude ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve views, expires_at, backorder for every item.", "sql": null}, {"role": "assistant", "content": "SELECT views, expires_at, backorder FROM insurance.items;", "sql": null}, {"role": "user", "content": "Show me items that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT views, expires_at, backorder FROM insurance.items WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of items across different backorder values.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, COUNT(*) AS count FROM insurance.items GROUP BY backorder ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations;", "sql": null}, {"role": "user", "content": "Find reservations created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations WHERE traded_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get min of payment_status by processed_at from reservations.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MIN(payment_status) AS min_payment_status FROM insurance.reservations GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.items;", "sql": null}, {"role": "user", "content": "Get all items created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.items WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up items by title.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM insurance.items GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me edited_at, user_id, comment_id for all posts.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, user_id, comment_id FROM insurance.posts;", "sql": null}, {"role": "user", "content": "List posts with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, user_id, comment_id FROM insurance.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, user_id, comment_id FROM insurance.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "List backorder, views, product_id from items.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, views, product_id FROM insurance.items;", "sql": null}, {"role": "user", "content": "Show the results sorted by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, views, product_id FROM insurance.items ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of items across different views values.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM insurance.items GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "List title, expires_at, backorder from items.", "sql": null}, {"role": "assistant", "content": "SELECT title, expires_at, backorder FROM insurance.items;", "sql": null}, {"role": "user", "content": "Arrange the results with manufacturer in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT title, expires_at, backorder FROM insurance.items ORDER BY manufacturer DESC;", "sql": null}, {"role": "user", "content": "Count the number of items in each title category.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM insurance.items GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Get rating, user_id, message from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, message FROM insurance.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, message FROM insurance.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, message FROM insurance.posts WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY edited_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations;", "sql": null}, {"role": "user", "content": "List reservations with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.reservations WHERE traded_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of reservations across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM insurance.reservations GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE insurance.reservations (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n traded_at date,\n payment_method character varying(256),\n status varchar,\n user_id text NOT NULL,\n payment_status character varying(128)\n)\n\nCREATE TABLE insurance.items (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n views char,\n backorder char,\n manufacturer character varying(64),\n title varchar NOT NULL\n)\n\nCREATE TABLE insurance.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n categories character varying(64),\n user_id character varying(128) -- identifier for user,\n rating character varying(256) NOT NULL,\n message character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.items;", "sql": null}, {"role": "user", "content": "Find items older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.items WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM insurance.items WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get cost, id, thumbnail_url from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT cost, id, thumbnail_url FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT cost, id, thumbnail_url FROM e-commerce.inventory WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different quantity values.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM e-commerce.inventory GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match price > 95.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE price > 95;", "sql": null}, {"role": "user", "content": "Show the results sorted by quantity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE price > 95 ORDER BY quantity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory with price > 20.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE price > 20;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE price > 20 ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "List price, published_at, cost from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, cost FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Can you order these by published_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, cost FROM e-commerce.inventory ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by cost descending.", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, cost FROM e-commerce.inventory ORDER BY cost DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "List price, id, thumbnail_url from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT price, id, thumbnail_url FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Can you order these by cost descending?", "sql": null}, {"role": "assistant", "content": "SELECT price, id, thumbnail_url FROM e-commerce.inventory ORDER BY cost DESC;", "sql": null}, {"role": "user", "content": "Order the output by shippin_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT price, id, thumbnail_url FROM e-commerce.inventory ORDER BY shippin_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group inventory by cost and show the count of shippin_id.", "sql": null}, {"role": "assistant", "content": "SELECT cost, COUNT(shippin_id) AS count_shippin_id FROM e-commerce.inventory GROUP BY cost;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve cost, id, thumbnail_url for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT cost, id, thumbnail_url FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with cost in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT cost, id, thumbnail_url FROM e-commerce.inventory ORDER BY cost ASC;", "sql": null}, {"role": "user", "content": "Show me the count of inventory grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM e-commerce.inventory GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of inventory in each cost category.", "sql": null}, {"role": "assistant", "content": "SELECT cost, COUNT(*) AS count FROM e-commerce.inventory GROUP BY cost ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n cancelled_at date,\n seller_id text,\n account_id char,\n amount smallint NOT NULL,\n delivery_status character varying(64),\n card_type character varying(256) NOT NULL\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url char,\n price integer,\n cost numeric NOT NULL,\n quantity text,\n shippin_id text -- reference to shipping.transaction_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(transaction_id)\n)", "conversations": [{"role": "user", "content": "List price, id, thumbnail_url from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT price, id, thumbnail_url FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "What thumbnail_url, price, delivery_status, created_at do we have for inventory and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT price, id, thumbnail_url, shipping.delivery_status, shipping.created_at FROM e-commerce.inventory JOIN e-commerce.shipping ON inventory.shippin_id = shipping.transaction_id;", "sql": null}, {"role": "user", "content": "Group inventory by shippin_id and show the min of cost.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, MIN(cost) AS min_cost FROM e-commerce.inventory GROUP BY shippin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n name varchar NOT NULL,\n city character varying(128),\n state character varying(256) NOT NULL,\n description character varying(128) NOT NULL,\n country varchar NOT NULL,\n accessibility varchar,\n type character varying(128),\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.courses (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subject char,\n user_id character varying(64) -- identifier for user,\n body character varying(256),\n attachment_url character varying(128) NOT NULL,\n message character varying(128) NOT NULL,\n student_id text NOT NULL -- reference to students.customer_id,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n display_name character varying(256),\n last_name character varying(128),\n password_hash character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where enrollment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE enrollment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up students by display_name.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.students GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n name varchar NOT NULL,\n city character varying(128),\n state character varying(256) NOT NULL,\n description character varying(128) NOT NULL,\n country varchar NOT NULL,\n accessibility varchar,\n type character varying(128),\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.courses (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subject char,\n user_id character varying(64) -- identifier for user,\n body character varying(256),\n attachment_url character varying(128) NOT NULL,\n message character varying(128) NOT NULL,\n student_id text NOT NULL -- reference to students.customer_id,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n display_name character varying(256),\n last_name character varying(128),\n password_hash character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by last_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_name DESC;", "sql": null}, {"role": "user", "content": "Calculate min of last_active for each display_name in students.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, MIN(last_active) AS min_last_active FROM education.students GROUP BY display_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n name varchar NOT NULL,\n city character varying(128),\n state character varying(256) NOT NULL,\n description character varying(128) NOT NULL,\n country varchar NOT NULL,\n accessibility varchar,\n type character varying(128),\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.courses (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subject char,\n user_id character varying(64) -- identifier for user,\n body character varying(256),\n attachment_url character varying(128) NOT NULL,\n message character varying(128) NOT NULL,\n student_id text NOT NULL -- reference to students.customer_id,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n display_name character varying(256),\n last_name character varying(128),\n password_hash character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Display all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Can you order these by user_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses ORDER BY user_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_inspected timestamp without time zone,\n name varchar NOT NULL,\n city character varying(128),\n state character varying(256) NOT NULL,\n description character varying(128) NOT NULL,\n country varchar NOT NULL,\n accessibility varchar,\n type character varying(128),\n student_id text NOT NULL -- reference to students.customer_id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id)\n)\n\nCREATE TABLE education.courses (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subject char,\n user_id character varying(64) -- identifier for user,\n body character varying(256),\n attachment_url character varying(128) NOT NULL,\n message character varying(128) NOT NULL,\n student_id text NOT NULL -- reference to students.customer_id,\n enrollment_id text NOT NULL -- reference to enrollments.id,\n FOREIGN KEY (student_id) REFERENCES students(customer_id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)\n\nCREATE TABLE education.students (\n customer_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n display_name character varying(256),\n last_name character varying(128),\n password_hash character varying(128) NOT NULL,\n enrollment_id text -- reference to enrollments.id,\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "How many students are there per display_name?", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM education.students GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List cancelled_at, seller_id, created_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, seller_id, created_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, seller_id, created_at FROM socialmedia.events WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up events by group_id.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(*) AS count FROM socialmedia.events GROUP BY group_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "What are the like_id, country, last_inspected of each group?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, country, last_inspected FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Can you order these by country ascending?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, country, last_inspected FROM socialmedia.groups ORDER BY country ASC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, country, last_inspected FROM socialmedia.groups ORDER BY country ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Display all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me country, last_inspected, created_at, cost from groups and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.created_at, likes.cost FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Can you order these by country ascending?", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.created_at, likes.cost FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "List events that have delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE delivery_status LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "What are the last_inspected, country, location_lat of each group?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, country, location_lat FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Arrange the results with location_lat in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, country, location_lat FROM socialmedia.groups ORDER BY location_lat ASC;", "sql": null}, {"role": "user", "content": "Sort the results by like_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, country, location_lat FROM socialmedia.groups ORDER BY like_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show the results sorted by buyer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY buyer_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY buyer_id ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "List country, location_lat, cost, category for each group along with their like information.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.cost, likes.category FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.cost, likes.category FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List discount, group_id, created_at from events.", "sql": null}, {"role": "assistant", "content": "SELECT discount, group_id, created_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What subtotal, delivery_status, capacity, last_inspected do we have for events and their associated groups?", "sql": null}, {"role": "assistant", "content": "SELECT discount, group_id, created_at, groups.capacity, groups.last_inspected FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT discount, group_id, created_at, groups.capacity, groups.last_inspected FROM socialmedia.events JOIN socialmedia.groups ON events.group_id = groups.id ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Show me capacity, like_id, category, created_at from groups and their related likes.", "sql": null}, {"role": "assistant", "content": "SELECT *, likes.category, likes.created_at FROM socialmedia.groups JOIN socialmedia.likes ON groups.like_id = likes.product_id;", "sql": null}, {"role": "user", "content": "Show me the count of groups grouped by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM socialmedia.groups GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.groups (\n id varchar PRIMARY KEY -- unique identifier,\n last_inspected date,\n capacity character varying(128),\n country char,\n location_lat text NOT NULL,\n like_id text -- reference to likes.product_id,\n FOREIGN KEY (like_id) REFERENCES likes(product_id)\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n age varchar,\n status character varying(256),\n language text,\n nationality text NOT NULL\n)\n\nCREATE TABLE socialmedia.events (\n payment_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n created_at date,\n subtotal decimal,\n buyer_id character varying(128),\n seller_id character varying(128) NOT NULL,\n discount decimal,\n delivery_status character varying(256),\n group_id text NOT NULL -- reference to groups.id,\n FOREIGN KEY (group_id) REFERENCES groups(id)\n)\n\nCREATE TABLE socialmedia.likes (\n product_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n category character varying(256) NOT NULL,\n brand character varying(256) NOT NULL,\n cost numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Get all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Arrange the results with group_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY group_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Show me capacity, operating_hours, parking_available for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, operating_hours, parking_available FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Get all doctors from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, operating_hours, parking_available FROM healthcare.doctors WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with operating_hours in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, operating_hours, parking_available FROM healthcare.doctors WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY operating_hours ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Retrieve parking_available, updated_at, capacity for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, updated_at, capacity FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show the results sorted by capacity descending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, updated_at, capacity FROM healthcare.doctors ORDER BY capacity DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by parking_available descending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, updated_at, capacity FROM healthcare.doctors ORDER BY parking_available DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Retrieve capacity, parking_available, operating_hours for every doctor.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, parking_available, operating_hours FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, parking_available, operating_hours FROM healthcare.doctors WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with capacity in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, parking_available, operating_hours FROM healthcare.doctors WHERE parking_available LIKE 'A%' ORDER BY capacity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Retrieve appointment_id, location_lat, operating_hours for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, location_lat, operating_hours FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, location_lat, operating_hours FROM healthcare.billing WHERE last_inspected > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_inspected descending.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, location_lat, operating_hours FROM healthcare.billing WHERE last_inspected > '2023-12-01' ORDER BY last_inspected DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing that have zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group billing by last_inspected and show the min of zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, MIN(zip_code) AS min_zip_code FROM healthcare.billing GROUP BY last_inspected;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by parking_available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY parking_available ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of billing in each location_lat category.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM healthcare.billing GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List updated_at, parking_available, last_inspected, location_lon for each doctor along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.last_inspected, billing.location_lon FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.venue_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.last_inspected, billing.location_lon FROM healthcare.doctors JOIN healthcare.billing ON doctors.billin_id = billing.venue_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.doctors (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available character varying(128) NOT NULL,\n capacity character varying(128),\n operating_hours character varying(256),\n billin_id text NOT NULL -- reference to billing.venue_id,\n FOREIGN KEY (billin_id) REFERENCES billing(venue_id)\n)\n\nCREATE TABLE healthcare.billing (\n venue_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n operating_hours character varying(64),\n location_lat character varying(256),\n location_lon char,\n zip_code text,\n longitude character varying(256),\n doctor_id text NOT NULL -- reference to doctors.venue_id,\n appointment_id text -- reference to appointments.address_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(venue_id),\n FOREIGN KEY (appointment_id) REFERENCES appointments(address_id)\n)\n\nCREATE TABLE healthcare.appointments (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n last_inspected timestamp without time zone,\n accessibility character varying(128),\n parking_available char,\n city character varying(128),\n type character varying(256) NOT NULL,\n timezone varchar\n)", "conversations": [{"role": "user", "content": "List zip_code, doctor_id, last_inspected from billing.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, doctor_id, last_inspected FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Get appointment_id, operating_hours, capacity, operating_hours by joining billing with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, doctor_id, last_inspected, doctors.capacity, doctors.operating_hours FROM healthcare.billing JOIN healthcare.doctors ON billing.doctor_id = doctors.venue_id;", "sql": null}, {"role": "user", "content": "What is the sum doctor_id for each location_lon in billing?", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, SUM(doctor_id) AS sum_doctor_id FROM healthcare.billing GROUP BY location_lon;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "List all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores;", "sql": null}, {"role": "user", "content": "Find stores between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with verification_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.accounts ORDER BY verification_status ASC;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.accounts ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "What are the balance, vendor_id, purchase_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT balance, vendor_id, purchase_id FROM media.accounts;", "sql": null}, {"role": "user", "content": "Sort the results by payee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT balance, vendor_id, purchase_id FROM media.accounts ORDER BY payee_id DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT balance, vendor_id, purchase_id FROM media.accounts ORDER BY payee_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Get account_id, country, updated_at from all stores.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, country, updated_at FROM media.stores;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, country, updated_at FROM media.stores ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with geo_point in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, country, updated_at FROM media.stores ORDER BY geo_point DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Show me description, geo_point, country for all stores.", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, country FROM media.stores;", "sql": null}, {"role": "user", "content": "Get stores that match account_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, country FROM media.stores WHERE account_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT description, geo_point, country FROM media.stores WHERE account_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Show me account_id, card_type, exchange_rate for all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, exchange_rate FROM media.purchases;", "sql": null}, {"role": "user", "content": "Can you order these by price descending?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, exchange_rate FROM media.purchases ORDER BY price DESC;", "sql": null}, {"role": "user", "content": "Can you order these by card_type ascending?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, card_type, exchange_rate FROM media.purchases ORDER BY card_type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores;", "sql": null}, {"role": "user", "content": "Get stores that match parking_available LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores WHERE parking_available LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.stores WHERE parking_available LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM media.purchases;", "sql": null}, {"role": "user", "content": "Show me exchange_rate, account_id, description, zip_code from purchases and their related stores.", "sql": null}, {"role": "assistant", "content": "SELECT *, stores.description, stores.zip_code FROM media.purchases JOIN media.stores ON purchases.store_id = stores.id;", "sql": null}, {"role": "user", "content": "Tally up purchases by store_id.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, COUNT(*) AS count FROM media.purchases GROUP BY store_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE media.purchases (\n order_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n amount numeric,\n exchange_rate character varying(128),\n total integer NOT NULL,\n card_type char NOT NULL,\n price bigint,\n store_id text -- reference to stores.id,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (store_id) REFERENCES stores(id),\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)\n\nCREATE TABLE media.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n verification_status char,\n amount numeric NOT NULL,\n payee_id varchar NOT NULL -- identifier for payee,\n vendor_id text -- identifier for vendor,\n balance numeric,\n purchase_id text NOT NULL -- reference to purchases.order_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(order_id)\n)\n\nCREATE TABLE media.stores (\n id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n updated_at timestamp,\n zip_code varchar NOT NULL,\n parking_available text,\n location_lat char,\n geo_point char,\n country text NOT NULL,\n name char,\n description character varying(256) NOT NULL,\n account_id text NOT NULL -- reference to accounts.account_id,\n FOREIGN KEY (account_id) REFERENCES accounts(account_id)\n)", "conversations": [{"role": "user", "content": "What are the balance, purchase_id, updated_at of each account?", "sql": null}, {"role": "assistant", "content": "SELECT balance, purchase_id, updated_at FROM media.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by verification_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT balance, purchase_id, updated_at FROM media.accounts ORDER BY verification_status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT balance, purchase_id, updated_at FROM media.accounts ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Retrieve customer_id, cancelled_at, joined_at, gender showing the relationship between payments and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.gender FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by seller_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.gender FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id ORDER BY seller_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me reference_number, reconciliation_status, credit for all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, reconciliation_status, credit FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts with notes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, reconciliation_status, credit FROM finance.accounts WHERE notes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of reconciliation_status grouped by customer_id for accounts.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, AVERAGE(reconciliation_status) AS average_reconciliation_status FROM finance.accounts GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get reference_number, customer_id, phone, account_status by joining accounts with customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.phone, customers.account_status FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by credit descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.phone, customers.account_status FROM finance.accounts JOIN finance.customers ON accounts.customer_id = customers.customer_id ORDER BY credit DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "List account_status, joined_at, updated_at from customers.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, joined_at, updated_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where phone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, joined_at, updated_at FROM finance.customers WHERE phone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, joined_at, updated_at FROM finance.customers WHERE phone LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me payment_status, cancelled_at, processed_at for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, cancelled_at, processed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, cancelled_at, processed_at FROM finance.payments ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Show me sum of processed_at grouped by delivery_status for payments.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, SUM(processed_at) AS sum_processed_at FROM finance.payments GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Retrieve delivery_status, customer_id, processed_at for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, customer_id, processed_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Show me payments with processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, customer_id, processed_at FROM finance.payments WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get average of customer_id by cancelled_at from payments.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, AVERAGE(customer_id) AS average_customer_id FROM finance.payments GROUP BY cancelled_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "List processed_at, delivery_status, customer_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, delivery_status, customer_id FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, delivery_status, customer_id FROM finance.payments WHERE cancelled_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.payments GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "What cancelled_at, processed_at, email, joined_at do we have for payments and their associated customers?", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.email, customers.joined_at FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Order the output by amount descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.email, customers.joined_at FROM finance.payments JOIN finance.customers ON payments.customer_id = customers.customer_id ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n notes character varying(256) NOT NULL,\n credit char,\n reference_number varchar,\n approval_status text,\n reconciliation_status character varying(256) NOT NULL,\n customer_id text -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.payments (\n order_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n delivery_status varchar,\n product_id character varying(256),\n amount bigint,\n seller_id character varying(128) -- identifier for seller,\n payment_status char NOT NULL,\n customer_id text NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE finance.customers (\n customer_id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status character varying(256),\n gender character varying(256),\n phone varchar,\n email character varying(256),\n payment_id text NOT NULL -- reference to payments.order_id,\n FOREIGN KEY (payment_id) REFERENCES payments(order_id)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve accounts where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by reference_number ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE updated_at > '2023-01-01' ORDER BY reference_number ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the image_url, price, expires_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, price, expires_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Get price, thumbnail_url, card_type, subtotal by joining grades with departments.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, price, expires_at, departments.card_type, departments.subtotal FROM education.grades JOIN education.departments ON grades.department_id = departments.payment_id;", "sql": null}, {"role": "user", "content": "Get min of barcode by price from grades.", "sql": null}, {"role": "assistant", "content": "SELECT price, MIN(barcode) AS min_barcode FROM education.grades GROUP BY price;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show the results sorted by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY expires_at DESC;", "sql": null}, {"role": "user", "content": "Order the output by barcode ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY barcode ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where barcode LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE barcode LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up grades by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM education.grades GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me expires_at, thumbnail_url, processed_at, card_type from grades and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.processed_at, departments.card_type FROM education.grades JOIN education.departments ON grades.department_id = departments.payment_id;", "sql": null}, {"role": "user", "content": "Show me the count of grades grouped by thumbnail_url.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM education.grades GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the max image_url for each department_id in grades?", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MAX(image_url) AS max_image_url FROM education.grades GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with department_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE expires_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY department_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me barcode, price, department_id for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, price, department_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, price, department_id FROM education.grades WHERE expires_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Get average of thumbnail_url by thumbnail_url from grades.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, AVERAGE(thumbnail_url) AS average_thumbnail_url FROM education.grades GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "List thumbnail_url, image_url, price from grades.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, image_url, price FROM education.grades;", "sql": null}, {"role": "user", "content": "List barcode, image_url, fee, card_type for each grade along with their department information.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, image_url, price, departments.fee, departments.card_type FROM education.grades JOIN education.departments ON grades.department_id = departments.payment_id;", "sql": null}, {"role": "user", "content": "Get the distribution of grades across different thumbnail_url values.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM education.grades GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve barcode, image_url, department_id for every grade.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, image_url, department_id FROM education.grades;", "sql": null}, {"role": "user", "content": "List grades with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, image_url, department_id FROM education.grades WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the average price for each barcode in grades?", "sql": null}, {"role": "assistant", "content": "SELECT barcode, AVERAGE(price) AS average_price FROM education.grades GROUP BY barcode;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n product_id text -- identifier for product,\n subtotal smallint,\n discount numeric,\n card_type text NOT NULL,\n fee character varying(128)\n)\n\nCREATE TABLE education.grades (\n barcode character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n thumbnail_url char,\n image_url character varying(64) NOT NULL,\n price integer NOT NULL,\n department_id text -- reference to departments.payment_id,\n FOREIGN KEY (department_id) REFERENCES departments(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me price, expires_at, card_type, product_id from grades and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.card_type, departments.product_id FROM education.grades JOIN education.departments ON grades.department_id = departments.payment_id;", "sql": null}, {"role": "user", "content": "Tally up grades by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM education.grades GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n stock_level character varying(64),\n reserved varchar,\n rating text,\n popularity_score character varying(64),\n title character varying(128),\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status varchar NOT NULL,\n website character varying(64),\n last_login timestamp without time zone,\n api_key char,\n order_item_id text NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n price numeric(38,14),\n discount decimal NOT NULL,\n payment_status text\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url text,\n media_url character varying(64),\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at timestamp,\n amount smallint,\n description character varying(64),\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY title DESC;", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, COUNT(*) AS count FROM e-commerce.products GROUP BY stock_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n stock_level character varying(64),\n reserved varchar,\n rating text,\n popularity_score character varying(64),\n title character varying(128),\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status varchar NOT NULL,\n website character varying(64),\n last_login timestamp without time zone,\n api_key char,\n order_item_id text NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n price numeric(38,14),\n discount decimal NOT NULL,\n payment_status text\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url text,\n media_url character varying(64),\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at timestamp,\n amount smallint,\n description character varying(64),\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY updated_at ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n stock_level character varying(64),\n reserved varchar,\n rating text,\n popularity_score character varying(64),\n title character varying(128),\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status varchar NOT NULL,\n website character varying(64),\n last_login timestamp without time zone,\n api_key char,\n order_item_id text NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n price numeric(38,14),\n discount decimal NOT NULL,\n payment_status text\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url text,\n media_url character varying(64),\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at timestamp,\n amount smallint,\n description character varying(64),\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users where order_item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE order_item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of api_key grouped by last_login for users.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, COUNT(api_key) AS count_api_key FROM e-commerce.users GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n stock_level character varying(64),\n reserved varchar,\n rating text,\n popularity_score character varying(64),\n title character varying(128),\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status varchar NOT NULL,\n website character varying(64),\n last_login timestamp without time zone,\n api_key char,\n order_item_id text NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n price numeric(38,14),\n discount decimal NOT NULL,\n payment_status text\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url text,\n media_url character varying(64),\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at timestamp,\n amount smallint,\n description character varying(64),\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where order_item_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE order_item_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by last_login ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE order_item_id LIKE 'A%' ORDER BY last_login ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n stock_level character varying(64),\n reserved varchar,\n rating text,\n popularity_score character varying(64),\n title character varying(128),\n user_id integer NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE e-commerce.users (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at date,\n updated_at timestamp without time zone,\n account_status varchar NOT NULL,\n website character varying(64),\n last_login timestamp without time zone,\n api_key char,\n order_item_id text NOT NULL -- reference to order_items.transaction_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n price numeric(38,14),\n discount decimal NOT NULL,\n payment_status text\n)\n\nCREATE TABLE e-commerce.inventory (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n thumbnail_url text,\n media_url character varying(64),\n title char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n processed_at timestamp,\n amount smallint,\n description character varying(64),\n approval_status varchar\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group products by stock_level and show the min of user_id.", "sql": null}, {"role": "assistant", "content": "SELECT stock_level, MIN(user_id) AS min_user_id FROM e-commerce.products GROUP BY stock_level;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by full_name descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY full_name DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY full_name DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Show me username, joined_at, employee_id for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT username, joined_at, employee_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by username descending?", "sql": null}, {"role": "assistant", "content": "SELECT username, joined_at, employee_id FROM healthcare.patients ORDER BY username DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT username, joined_at, employee_id FROM healthcare.patients ORDER BY username DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients with joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up patients by medical_record_id.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, COUNT(*) AS count FROM healthcare.patients GROUP BY medical_record_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by profile_picture_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY profile_picture_url ASC;", "sql": null}, {"role": "user", "content": "Can you order these by medical_record_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY medical_record_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have employee_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE employee_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by employee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE employee_id LIKE 'A%' ORDER BY employee_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Arrange the results with joined_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY joined_at ASC;", "sql": null}, {"role": "user", "content": "What is the min medical_record_id for each employee_id in patients?", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, MIN(medical_record_id) AS min_medical_record_id FROM healthcare.patients GROUP BY employee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n product_id text PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n created_at timestamp without time zone,\n discount numeric,\n brand character varying(256) NOT NULL,\n available text NOT NULL\n)\n\nCREATE TABLE healthcare.doctors (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n username char,\n bio character varying(64),\n address text,\n phone character varying(64),\n last_name varchar\n)\n\nCREATE TABLE healthcare.departments (\n sku character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n manufacturer char,\n subcategory char,\n category character varying(256) NOT NULL,\n rating text,\n popularity_score varchar,\n brand character varying(128) NOT NULL\n)\n\nCREATE TABLE healthcare.appointments (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n avatar character varying(256),\n city char NOT NULL,\n state character varying(64),\n status character varying(64),\n timezone character varying(128)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n username varchar NOT NULL,\n profile_picture_url character varying(64) NOT NULL,\n full_name text,\n medical_record_id text -- reference to medical_records.product_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(product_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "List balance, patient_id, updated_at from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT balance, patient_id, updated_at FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where vendor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT balance, patient_id, updated_at FROM healthcare.appointments WHERE vendor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT balance, patient_id, updated_at FROM healthcare.appointments WHERE vendor_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show the results sorted by patient_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY patient_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments ORDER BY patient_id ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "What appointment_id, state, patient_id, credit do we have for patients and their associated appointments?", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.patient_id, appointments.credit FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.invoice_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by state descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, appointments.patient_id, appointments.credit FROM healthcare.patients JOIN healthcare.appointments ON patients.appointment_id = appointments.invoice_id ORDER BY state DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "List balance, patient_id, display_name, last_active for each appointment along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.display_name, patients.last_active FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.person_id;", "sql": null}, {"role": "user", "content": "Tally up appointments by balance.", "sql": null}, {"role": "assistant", "content": "SELECT balance, COUNT(*) AS count FROM healthcare.appointments GROUP BY balance ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get updated_at, created_at, vendor_id from all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, vendor_id FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, vendor_id FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, vendor_id FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve display_name, appointment_id, last_active for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, appointment_id, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by state descending.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, appointment_id, last_active FROM healthcare.patients ORDER BY state DESC;", "sql": null}, {"role": "user", "content": "Order the output by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, appointment_id, last_active FROM healthcare.patients ORDER BY display_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where balance > 5.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE balance > 5;", "sql": null}, {"role": "user", "content": "Calculate sum of notes for each exchange_rate in appointments.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, SUM(notes) AS sum_notes FROM healthcare.appointments GROUP BY exchange_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, state, last_name of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, state, last_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, state, last_name FROM healthcare.patients WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "What is the average state for each updated_at in patients?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(state) AS average_state FROM healthcare.patients GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Arrange the results with updated_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n updated_at timestamp without time zone,\n balance numeric,\n notes text,\n vendor_id character varying(64),\n exchange_rate char,\n credit character varying(256) NOT NULL,\n patient_id integer -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n updated_at timestamp without time zone,\n last_name character varying(64) NOT NULL,\n state text,\n display_name character varying(64),\n appointment_id text -- reference to appointments.invoice_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by appointment_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY appointment_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get id, available, name from all products.", "sql": null}, {"role": "assistant", "content": "SELECT id, available, name FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve quantity, name, payer_id, balance showing the relationship between products and shipping.", "sql": null}, {"role": "assistant", "content": "SELECT id, available, name, shipping.payer_id, shipping.balance FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.payment_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT id, available, name, shipping.payer_id, shipping.balance FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.payment_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me quantity, name, payment_date, invoice_number from products and their related shipping.", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.payment_date, shipping.invoice_number FROM e-commerce.products JOIN e-commerce.shipping ON products.shippin_id = shipping.payment_id;", "sql": null}, {"role": "user", "content": "Group products by name and show the min of quantity.", "sql": null}, {"role": "assistant", "content": "SELECT name, MIN(quantity) AS min_quantity FROM e-commerce.products GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY quantity ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with quantity in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY quantity ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me expires_at, quantity, name for all products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, quantity, name FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products where shippin_id > 80.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, quantity, name FROM e-commerce.products WHERE shippin_id > 80;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, quantity, name FROM e-commerce.products WHERE shippin_id > 80 LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY available DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve quantity, available, media_url for every product.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, available, media_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, available, media_url FROM e-commerce.products WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of products in each id category.", "sql": null}, {"role": "assistant", "content": "SELECT id, COUNT(*) AS count FROM e-commerce.products GROUP BY id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "List name, id, shippin_id from products.", "sql": null}, {"role": "assistant", "content": "SELECT name, id, shippin_id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT name, id, shippin_id FROM e-commerce.products WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT name, id, shippin_id FROM e-commerce.products WHERE expires_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with shippin_id > 20.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE shippin_id > 20;", "sql": null}, {"role": "user", "content": "Sort the results by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE shippin_id > 20 ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Order the output by quantity ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY quantity ASC;", "sql": null}, {"role": "user", "content": "Show me the count of products grouped by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM e-commerce.products GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n invoice_number character varying(256) NOT NULL,\n payer_id character varying(128),\n user_id character varying(64) -- identifier for user,\n balance integer,\n verification_status char\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n available character varying(256),\n quantity char,\n media_url char,\n name text NOT NULL,\n shippin_id integer -- reference to shipping.payment_id,\n FOREIGN KEY (shippin_id) REFERENCES shipping(payment_id)\n)\n\nCREATE TABLE e-commerce.categories (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n last_login timestamp NOT NULL,\n birth_date date NOT NULL,\n timezone varchar,\n password_hash character varying(64) NOT NULL,\n is_verified bit\n)\n\nCREATE TABLE e-commerce.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n address character varying(64) NOT NULL,\n membership_level character varying(256),\n last_name text NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the available, id, expires_at of each product?", "sql": null}, {"role": "assistant", "content": "SELECT available, id, expires_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show the results sorted by name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT available, id, expires_at FROM e-commerce.products ORDER BY name ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of name for each shippin_id in products.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, SUM(name) AS sum_name FROM e-commerce.products GROUP BY shippin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n invoice_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n created_at timestamp without time zone,\n card_type character varying(256) NOT NULL,\n customer_id varchar -- identifier for customer,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(256) NOT NULL,\n loan_id text -- reference to loans.location_id,\n FOREIGN KEY (loan_id) REFERENCES loans(location_id)\n)\n\nCREATE TABLE finance.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n created_at date,\n user_id character varying(128) NOT NULL -- identifier for user,\n card_type character varying(128),\n exchange_rate character varying(256),\n buyer_id text -- identifier for buyer,\n tax numeric NOT NULL,\n customer_id text -- reference to customers.person_id,\n FOREIGN KEY (customer_id) REFERENCES customers(person_id)\n)\n\nCREATE TABLE finance.customers (\n person_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n is_verified bit,\n api_key varchar NOT NULL,\n nationality text NOT NULL,\n last_login timestamp,\n transaction_id integer NOT NULL -- reference to transactions.invoice_id,\n loan_id text NOT NULL -- reference to loans.location_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(invoice_id),\n FOREIGN KEY (loan_id) REFERENCES loans(location_id)\n)\n\nCREATE TABLE finance.loans (\n location_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n parking_available text,\n type character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by traded_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY traded_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Get reply_to_id, created_at, body from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, created_at, body FROM government.reviews;", "sql": null}, {"role": "user", "content": "Get reviews that match title LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, created_at, body FROM government.reviews WHERE title LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, created_at, body FROM government.reviews WHERE title LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "What are the debit, customer_id, due_date of each account?", "sql": null}, {"role": "assistant", "content": "SELECT debit, customer_id, due_date FROM government.accounts;", "sql": null}, {"role": "user", "content": "Show me accounts that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT debit, customer_id, due_date FROM government.accounts WHERE due_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT debit, customer_id, due_date FROM government.accounts WHERE due_date > '2023-12-01' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List title, patient_id, likes from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT title, patient_id, likes FROM government.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT title, patient_id, likes FROM government.reviews WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with title in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT title, patient_id, likes FROM government.reviews WHERE created_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Get patient_id, likes, title from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, likes, title FROM government.reviews;", "sql": null}, {"role": "user", "content": "Order the output by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, likes, title FROM government.reviews ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with patient_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, likes, title FROM government.reviews ORDER BY patient_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Display all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews;", "sql": null}, {"role": "user", "content": "Order the output by content descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews ORDER BY content DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews ORDER BY content DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, review_id, first_name from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, review_id, first_name FROM government.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by first_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, review_id, first_name FROM government.patients ORDER BY first_name ASC;", "sql": null}, {"role": "user", "content": "Show me average of birth_date grouped by review_id for patients.", "sql": null}, {"role": "assistant", "content": "SELECT review_id, AVERAGE(birth_date) AS average_birth_date FROM government.patients GROUP BY review_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Display all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.patients;", "sql": null}, {"role": "user", "content": "Find patients where first_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.patients WHERE first_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.patients WHERE first_name LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.accounts;", "sql": null}, {"role": "user", "content": "Find accounts modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.accounts WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.accounts WHERE due_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.reviews (\n message_id text PRIMARY KEY -- unique identifier,\n created_at date,\n title character varying(256),\n body varchar NOT NULL,\n author_id text,\n content char,\n media_url char NOT NULL,\n reply_to_id char -- identifier for reply_to,\n likes character varying(256) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.person_id,\n FOREIGN KEY (patient_id) REFERENCES patients(person_id)\n)\n\nCREATE TABLE government.patients (\n person_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n first_name character varying(256) NOT NULL,\n birth_date timestamp without time zone NOT NULL,\n profile_picture_url character varying(64),\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n review_id text NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE government.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n category text,\n credit text,\n approval_status varchar NOT NULL,\n customer_id text,\n debit character varying(128),\n reconciliation_status char NOT NULL,\n notes text,\n review_id text -- reference to reviews.message_id,\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)", "conversations": [{"role": "user", "content": "List all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.reviews WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of reviews grouped by content.", "sql": null}, {"role": "assistant", "content": "SELECT content, COUNT(*) AS count FROM government.reviews GROUP BY content ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me updated_at, card_type, payment_status for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, card_type, payment_status FROM travel.orders;", "sql": null}, {"role": "user", "content": "Get orders that match currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, card_type, payment_status FROM travel.orders WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of status by status from orders.", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(status) AS average_status FROM travel.orders GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Get orders that match payment_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE payment_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of student_id grouped by card_type for orders.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, AVERAGE(student_id) AS average_student_id FROM travel.orders GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of orders grouped by student_id.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM travel.orders GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE currency LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Get orders that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of delivery_status grouped by updated_at for orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(delivery_status) AS average_delivery_status FROM travel.orders GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the currency, updated_at, delivery_status of each order?", "sql": null}, {"role": "assistant", "content": "SELECT currency, updated_at, delivery_status FROM travel.orders;", "sql": null}, {"role": "user", "content": "Show me updated_at, currency, created_at, age from orders and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT currency, updated_at, delivery_status, students.created_at, students.age FROM travel.orders JOIN travel.students ON orders.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Order the output by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, updated_at, delivery_status, students.created_at, students.age FROM travel.orders JOIN travel.students ON orders.student_id = students.user_id ORDER BY status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Order the output by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Group orders by card_type and show the count of status.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(status) AS count_status FROM travel.orders GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the card_type, created_at, status of each order?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, status FROM travel.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, status FROM travel.orders WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, created_at, status FROM travel.orders WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "Get orders that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum delivery_status for each currency in orders?", "sql": null}, {"role": "assistant", "content": "SELECT currency, SUM(delivery_status) AS sum_delivery_status FROM travel.orders GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.orders (\n order_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n status character varying(64),\n card_type character varying(64),\n payment_status character varying(64),\n currency varchar,\n account_id char -- identifier for account,\n delivery_status character varying(256),\n user_id varchar NOT NULL -- identifier for user,\n student_id text NOT NULL -- reference to students.user_id,\n FOREIGN KEY (student_id) REFERENCES students(user_id)\n)\n\nCREATE TABLE travel.addresses (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at date,\n coordinates character varying(256),\n operating_hours text NOT NULL,\n state character varying(64) NOT NULL,\n latitude character varying(64) NOT NULL\n)\n\nCREATE TABLE travel.students (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n status varchar,\n salt character varying(64) NOT NULL,\n age character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.orders;", "sql": null}, {"role": "user", "content": "What created_at, payment_status, created_at, age do we have for orders and their associated students?", "sql": null}, {"role": "assistant", "content": "SELECT *, students.created_at, students.age FROM travel.orders JOIN travel.students ON orders.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.created_at, students.age FROM travel.orders JOIN travel.students ON orders.student_id = students.user_id ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve email, zip_code, first_name for every member.", "sql": null}, {"role": "assistant", "content": "SELECT email, zip_code, first_name FROM humanresources.members;", "sql": null}, {"role": "user", "content": "Get members that match birth_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT email, zip_code, first_name FROM humanresources.members WHERE birth_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by message_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT email, zip_code, first_name FROM humanresources.members WHERE birth_date > '2023-01-01' ORDER BY message_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.members;", "sql": null}, {"role": "user", "content": "Show me email, username, thumbnail, member_id from members and their related messages.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.thumbnail, messages.member_id FROM humanresources.members JOIN humanresources.messages ON members.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by email descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.thumbnail, messages.member_id FROM humanresources.members JOIN humanresources.messages ON members.message_id = messages.post_id ORDER BY email DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Get all messages created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Order the output by member_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY member_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "List thumbnail, updated_at, updated_at, email for each message along with their member information.", "sql": null}, {"role": "assistant", "content": "SELECT *, members.updated_at, members.email FROM humanresources.messages JOIN humanresources.members ON messages.member_id = members.employee_id;", "sql": null}, {"role": "user", "content": "Get average of member_id by created_at from messages.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, AVERAGE(member_id) AS average_member_id FROM humanresources.messages GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me thumbnail, attachment_url, score for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, attachment_url, score FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Can you order these by member_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, attachment_url, score FROM humanresources.messages ORDER BY member_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by member_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, attachment_url, score FROM humanresources.messages ORDER BY member_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "List score, attachment_url, thumbnail from messages.", "sql": null}, {"role": "assistant", "content": "SELECT score, attachment_url, thumbnail FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT score, attachment_url, thumbnail FROM humanresources.messages WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT score, attachment_url, thumbnail FROM humanresources.messages WHERE updated_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.members;", "sql": null}, {"role": "user", "content": "Show me members with email LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.members WHERE email LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of members in each email category.", "sql": null}, {"role": "assistant", "content": "SELECT email, COUNT(*) AS count FROM humanresources.members GROUP BY email ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Group messages by attachment_url and show the max of score.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, MAX(score) AS max_score FROM humanresources.messages GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages;", "sql": null}, {"role": "user", "content": "Find messages where attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.messages WHERE attachment_url LIKE 'A%' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.members (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n username text NOT NULL,\n zip_code character varying(128),\n birth_date date,\n email char NOT NULL,\n first_name character varying(64),\n message_id text NOT NULL -- reference to messages.post_id,\n FOREIGN KEY (message_id) REFERENCES messages(post_id)\n)\n\nCREATE TABLE humanresources.messages (\n post_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n score character varying(128),\n attachment_url varchar,\n thumbnail text NOT NULL,\n member_id integer NOT NULL -- reference to members.employee_id,\n FOREIGN KEY (member_id) REFERENCES members(employee_id)\n)", "conversations": [{"role": "user", "content": "List all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.members;", "sql": null}, {"role": "user", "content": "What email, updated_at, attachment_url, member_id do we have for members and their associated messages?", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.attachment_url, messages.member_id FROM humanresources.members JOIN humanresources.messages ON members.message_id = messages.post_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, messages.attachment_url, messages.member_id FROM humanresources.members JOIN humanresources.messages ON members.message_id = messages.post_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "List created_at, street, order_id from logs.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, street, order_id FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List street, store_id, traded_at, seller_id for each log along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, street, order_id, orders.traded_at, orders.seller_id FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Tally up logs by street.", "sql": null}, {"role": "assistant", "content": "SELECT street, COUNT(*) AS count FROM tradingplatform.logs GROUP BY street ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate count of created_at for each updated_at in logs.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(created_at) AS count_created_at FROM tradingplatform.logs GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the profile_picture_url, state, created_at of each user?", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, created_at FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Order the output by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, created_at FROM tradingplatform.users ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different last_active values.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM tradingplatform.users GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve location_lat, street, created_at for every log.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, street, created_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, street, created_at FROM tradingplatform.logs ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, street, created_at FROM tradingplatform.logs ORDER BY created_at DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve street, latitude, order_id for every log.", "sql": null}, {"role": "assistant", "content": "SELECT street, latitude, order_id FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve street, store_id, seller_id, account_id showing the relationship between logs and orders.", "sql": null}, {"role": "assistant", "content": "SELECT street, latitude, order_id, orders.seller_id, orders.account_id FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT street, latitude, order_id, orders.seller_id, orders.account_id FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get state, avatar, profile_picture_url from all users.", "sql": null}, {"role": "assistant", "content": "SELECT state, avatar, profile_picture_url FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users where profile_picture_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT state, avatar, profile_picture_url FROM tradingplatform.users WHERE profile_picture_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT state, avatar, profile_picture_url FROM tradingplatform.users WHERE profile_picture_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve profile_picture_url, state, avatar for every user.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, avatar FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Find users where order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, avatar FROM tradingplatform.users WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, state, avatar FROM tradingplatform.users WHERE order_id LIKE 'A%' ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at timestamp,\n seller_id varchar -- identifier for seller,\n total numeric(38,14) NOT NULL,\n account_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.users (\n person_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n avatar character varying(64),\n state character varying(256),\n profile_picture_url varchar,\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n store_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n created_at date,\n latitude char NOT NULL,\n location_lat character varying(256),\n street varchar,\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve store_id, latitude, location_lat for every log.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, latitude, location_lat FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Arrange the results with order_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, latitude, location_lat FROM tradingplatform.logs ORDER BY order_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by location_lat ascending.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, latitude, location_lat FROM tradingplatform.logs ORDER BY location_lat ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Get birth_date, address, status from all students.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, address, status FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, address, status FROM education.students WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Tally up students by grade_id.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.students GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "List grade_id, timezone, street from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, timezone, street FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, timezone, street FROM education.assignments WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show me the count of assignments grouped by last_inspected.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM education.assignments GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "List grade_id, address, status from students.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, address, status FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, address, status FROM education.students WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, address, status FROM education.students WHERE updated_at > '2023-01-01' ORDER BY status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, address, grade_id for every student.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address, grade_id FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address, grade_id FROM education.students WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, address, grade_id FROM education.students WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by timezone descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY timezone DESC;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY timezone DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Show me membership_level, address, updated_at for all students.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, address, updated_at FROM education.students;", "sql": null}, {"role": "user", "content": "Retrieve students where membership_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, address, updated_at FROM education.students WHERE membership_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me count of grade_id grouped by address for students.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(grade_id) AS count_grade_id FROM education.students GROUP BY address;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Show me last_inspected, timezone, street for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, timezone, street FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with location_lat LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, timezone, street FROM education.assignments WHERE location_lat LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by street ascending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, timezone, street FROM education.assignments WHERE location_lat LIKE 'A%' ORDER BY street ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve address, birth_date, membership_level for every student.", "sql": null}, {"role": "assistant", "content": "SELECT address, birth_date, membership_level FROM education.students;", "sql": null}, {"role": "user", "content": "List students with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT address, birth_date, membership_level FROM education.students WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of students across different user_id values.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.students GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "What grade_id, last_inspected, created_at, media_url do we have for assignments and their associated grades?", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.created_at, grades.media_url FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.message_id;", "sql": null}, {"role": "user", "content": "Sort the results by street descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.created_at, grades.media_url FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.message_id ORDER BY street DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp,\n user_id character varying(256) NOT NULL,\n media_url character varying(64) NOT NULL,\n views character varying(256),\n description character varying(256)\n)\n\nCREATE TABLE education.assignments (\n venue_id character varying(64) NOT NULL -- unique identifier,\n last_inspected timestamp without time zone,\n state character varying(128),\n street char,\n timezone character varying(64) NOT NULL,\n address_line1 text,\n location_lat varchar,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)\n\nCREATE TABLE education.students (\n user_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n membership_level varchar NOT NULL,\n status char,\n birth_date date,\n address character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.message_id,\n FOREIGN KEY (grade_id) REFERENCES grades(message_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List updated_at, address, media_url, views for each student along with their grade information.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.media_url, grades.views FROM education.students JOIN education.grades ON students.grade_id = grades.message_id;", "sql": null}, {"role": "user", "content": "Count the number of students in each user_id category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM education.students GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "What are the payment_method, subtotal, product_id of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, product_id FROM music.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, product_id FROM music.transactions WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Group transactions by completed_at and show the sum of order_id.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, SUM(order_id) AS sum_order_id FROM music.transactions GROUP BY completed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "Get payment_method, subtotal, user_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, user_id FROM music.transactions;", "sql": null}, {"role": "user", "content": "Show the results sorted by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, user_id FROM music.transactions ORDER BY completed_at ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with amount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, subtotal, user_id FROM music.transactions ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions;", "sql": null}, {"role": "user", "content": "List transactions that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions WHERE user_id LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "Get amount, article_id, product_id from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT amount, article_id, product_id FROM music.transactions;", "sql": null}, {"role": "user", "content": "Get all transactions from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT amount, article_id, product_id FROM music.transactions WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT amount, article_id, product_id FROM music.transactions WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "List user_id, product_id, buyer_id from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, product_id, buyer_id FROM music.transactions;", "sql": null}, {"role": "user", "content": "Order the output by subtotal ascending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, product_id, buyer_id FROM music.transactions ORDER BY subtotal ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, product_id, buyer_id FROM music.transactions ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "List order_id, user_id, payment_method from transactions.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, user_id, payment_method FROM music.transactions;", "sql": null}, {"role": "user", "content": "What buyer_id, subtotal, attachment_url, subject do we have for transactions and their associated articles?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, user_id, payment_method, articles.attachment_url, articles.subject FROM music.transactions JOIN music.articles ON transactions.article_id = articles.id;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, user_id, payment_method, articles.attachment_url, articles.subject FROM music.transactions JOIN music.articles ON transactions.article_id = articles.id ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions;", "sql": null}, {"role": "user", "content": "Order the output by article_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions ORDER BY article_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions ORDER BY article_id DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "What are the amount, completed_at, payment_method of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT amount, completed_at, payment_method FROM music.transactions;", "sql": null}, {"role": "user", "content": "Get transactions that match amount > 12.", "sql": null}, {"role": "assistant", "content": "SELECT amount, completed_at, payment_method FROM music.transactions WHERE amount > 12;", "sql": null}, {"role": "user", "content": "How many transactions are there per payment_method?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM music.transactions GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "Get order_id, subtotal, payment_method from all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, subtotal, payment_method FROM music.transactions;", "sql": null}, {"role": "user", "content": "List article_id, amount, attachment_url, content for each transaction along with their article information.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, subtotal, payment_method, articles.attachment_url, articles.content FROM music.transactions JOIN music.articles ON transactions.article_id = articles.id;", "sql": null}, {"role": "user", "content": "Group transactions by buyer_id and show the max of product_id.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, MAX(product_id) AS max_product_id FROM music.transactions GROUP BY buyer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.articles (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n updated_at timestamp,\n attachment_url varchar,\n parent_id character varying(128) NOT NULL,\n tags char,\n content character varying(64),\n subject char\n)\n\nCREATE TABLE music.transactions (\n order_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n completed_at timestamp,\n buyer_id character varying(64) NOT NULL,\n payment_method char NOT NULL,\n subtotal smallint,\n product_id character varying(64) NOT NULL,\n user_id character varying(128),\n amount numeric,\n article_id text NOT NULL -- reference to articles.id,\n FOREIGN KEY (article_id) REFERENCES articles(id)\n)", "conversations": [{"role": "user", "content": "Display all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.transactions ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Group transactions by product_id and show the sum of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, SUM(updated_at) AS sum_updated_at FROM music.transactions GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me author_id, parent_id, published_at for all events.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, parent_id, published_at FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Arrange the results with parent_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, parent_id, published_at FROM socialmedia.events ORDER BY parent_id DESC;", "sql": null}, {"role": "user", "content": "Group events by follower_id and show the min of follower_id.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, MIN(follower_id) AS min_follower_id FROM socialmedia.events GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of followers in each currency category.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM socialmedia.followers GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get expires_at, available, created_at from all followers.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, created_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, created_at FROM socialmedia.followers ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of followers grouped by group_id.", "sql": null}, {"role": "assistant", "content": "SELECT group_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY group_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve expires_at, currency, rating for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, currency, rating FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, currency, rating FROM socialmedia.followers ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "What is the min group_id for each currency in followers?", "sql": null}, {"role": "assistant", "content": "SELECT currency, MIN(group_id) AS min_group_id FROM socialmedia.followers GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Retrieve events where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many events are there per author_id?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM socialmedia.events GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me available, rating, thumbnail, content from followers and their related groups.", "sql": null}, {"role": "assistant", "content": "SELECT *, groups.thumbnail, groups.content FROM socialmedia.followers JOIN socialmedia.groups ON followers.group_id = groups.post_id;", "sql": null}, {"role": "user", "content": "Get count of expires_at by available from followers.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(expires_at) AS count_expires_at FROM socialmedia.followers GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve currency, expires_at, available for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT currency, expires_at, available FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show the results sorted by popularity_score ascending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, expires_at, available FROM socialmedia.followers ORDER BY popularity_score ASC;", "sql": null}, {"role": "user", "content": "Tally up followers by currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM socialmedia.followers GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of followers grouped by rating.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM socialmedia.followers GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List body, published_at, parent_id from events.", "sql": null}, {"role": "assistant", "content": "SELECT body, published_at, parent_id FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What follower_id, body, rating, popularity_score do we have for events and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT body, published_at, parent_id, followers.rating, followers.popularity_score FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.barcode;", "sql": null}, {"role": "user", "content": "Arrange the results with follower_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT body, published_at, parent_id, followers.rating, followers.popularity_score FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.barcode ORDER BY follower_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode text PRIMARY KEY -- unique identifier,\n expires_at date,\n created_at timestamp without time zone,\n available character varying(64),\n popularity_score character varying(64) NOT NULL,\n rating text,\n currency character varying(256),\n group_id text NOT NULL -- reference to groups.post_id,\n FOREIGN KEY (group_id) REFERENCES groups(post_id)\n)\n\nCREATE TABLE socialmedia.events (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n author_id character varying(128) -- identifier for author,\n body character varying(256),\n parent_id character varying(128) -- identifier for parent,\n follower_id text -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)\n\nCREATE TABLE socialmedia.groups (\n post_id text PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n thumbnail character varying(64),\n shares char,\n content character varying(128),\n attachment_url character varying(128) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Show me min of popularity_score grouped by popularity_score for followers.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, MIN(popularity_score) AS min_popularity_score FROM socialmedia.followers GROUP BY popularity_score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by wallet_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY wallet_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve thumbnail_url, wallet_id, reconciliation_status, approval_status showing the relationship between assets and wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.reconciliation_status, wallets.approval_status FROM tradingplatform.assets JOIN tradingplatform.wallets ON assets.wallet_id = wallets.account_id;", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM tradingplatform.assets GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List approval_status, currency, thumbnail_url, price for each notification along with their asset information.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.thumbnail_url, assets.price FROM tradingplatform.notifications JOIN tradingplatform.assets ON notifications.asset_id = assets.sku;", "sql": null}, {"role": "user", "content": "Tally up notifications by subtotal.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by credit ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY credit ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of wallets across different credit values.", "sql": null}, {"role": "assistant", "content": "SELECT credit, COUNT(*) AS count FROM tradingplatform.wallets GROUP BY credit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate count of payment_status for each approval_status in notifications.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(payment_status) AS count_payment_status FROM tradingplatform.notifications GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Order the output by subtotal descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY subtotal DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by completed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY completed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me verification_status, asset_id, created_at, published_at from wallets and their related assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.created_at, assets.published_at FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.sku;", "sql": null}, {"role": "user", "content": "Show the results sorted by reconciliation_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.created_at, assets.published_at FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.sku ORDER BY reconciliation_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Show me payment_status, subtotal, asset_id for all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, subtotal, asset_id FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show the results sorted by completed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, subtotal, asset_id FROM tradingplatform.notifications ORDER BY completed_at DESC;", "sql": null}, {"role": "user", "content": "Show me the count of notifications grouped by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM tradingplatform.notifications GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "List all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Get credit, updated_at, thumbnail_url, featured_rank by joining wallets with assets.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.thumbnail_url, assets.featured_rank FROM tradingplatform.wallets JOIN tradingplatform.assets ON wallets.asset_id = assets.sku;", "sql": null}, {"role": "user", "content": "What is the average reconciliation_status for each due_date in wallets?", "sql": null}, {"role": "assistant", "content": "SELECT due_date, AVERAGE(reconciliation_status) AS average_reconciliation_status FROM tradingplatform.wallets GROUP BY due_date;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp,\n updated_at timestamp,\n approval_status text NOT NULL,\n credit character varying(128) NOT NULL,\n verification_status character varying(64) NOT NULL,\n reconciliation_status text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)\n\nCREATE TABLE tradingplatform.assets (\n sku integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at timestamp without time zone,\n thumbnail_url character varying(64),\n title char,\n featured_rank character varying(64) NOT NULL,\n price bigint NOT NULL,\n views varchar,\n wallet_id text NOT NULL -- reference to wallets.account_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n completed_at timestamp,\n payment_status character varying(256),\n subtotal numeric(38,14) NOT NULL,\n approval_status character varying(64),\n currency text,\n asset_id integer NOT NULL -- reference to assets.sku,\n FOREIGN KEY (asset_id) REFERENCES assets(sku)\n)", "conversations": [{"role": "user", "content": "Get created_at, published_at, featured_rank from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, published_at, featured_rank FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Get all assets from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, published_at, featured_rank FROM tradingplatform.assets WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by title descending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, published_at, featured_rank FROM tradingplatform.assets WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY title DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n views text,\n description char,\n title character varying(64),\n quantity character varying(256),\n log_id integer NOT NULL -- reference to logs.id,\n notification_id text -- reference to notifications.sku,\n FOREIGN KEY (log_id) REFERENCES logs(id),\n FOREIGN KEY (notification_id) REFERENCES notifications(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n email character varying(256),\n last_name text,\n status character varying(64),\n bio character varying(128) NOT NULL,\n is_verified bit,\n state varchar,\n log_id integer NOT NULL -- reference to logs.id,\n FOREIGN KEY (log_id) REFERENCES logs(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(256) NOT NULL,\n display_name char NOT NULL,\n is_verified boolean -- indicates if verified is true,\n age character varying(256)\n)\n\nCREATE TABLE tradingplatform.notifications (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n backorder varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n popularity_score text,\n asset_id text -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List notifications with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE expires_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE expires_at > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode text PRIMARY KEY -- unique identifier,\n published_at date,\n views text,\n description char,\n title character varying(64),\n quantity character varying(256),\n log_id integer NOT NULL -- reference to logs.id,\n notification_id text -- reference to notifications.sku,\n FOREIGN KEY (log_id) REFERENCES logs(id),\n FOREIGN KEY (notification_id) REFERENCES notifications(sku)\n)\n\nCREATE TABLE tradingplatform.users (\n employee_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n email character varying(256),\n last_name text,\n status character varying(64),\n bio character varying(128) NOT NULL,\n is_verified bit,\n state varchar,\n log_id integer NOT NULL -- reference to logs.id,\n FOREIGN KEY (log_id) REFERENCES logs(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n profile_picture_url character varying(256) NOT NULL,\n display_name char NOT NULL,\n is_verified boolean -- indicates if verified is true,\n age character varying(256)\n)\n\nCREATE TABLE tradingplatform.notifications (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n backorder varchar NOT NULL,\n video_url character varying(256) -- identifier for video_url,\n popularity_score text,\n asset_id text -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets where log_id > 82.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE log_id > 82;", "sql": null}, {"role": "user", "content": "Tally up assets by quantity.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM tradingplatform.assets GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments that have payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many assignments are there per department_id?", "sql": null}, {"role": "assistant", "content": "SELECT department_id, COUNT(*) AS count FROM education.assignments GROUP BY department_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the approval_status, completed_at, payment_method of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, completed_at, payment_method FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, completed_at, payment_method FROM education.assignments WHERE completed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of assignments in each seller_id category.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM education.assignments GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the amount, payment_id, department_id of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT amount, payment_id, department_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by student_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT amount, payment_id, department_id FROM education.assignments ORDER BY student_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT amount, payment_id, department_id FROM education.assignments ORDER BY student_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Order the output by seller_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY seller_id DESC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY seller_id DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE completed_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY amount ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of assignments across different student_id values.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.assignments GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "What are the traded_at, completed_at, seller_id of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, seller_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, completed_at, seller_id FROM education.assignments WHERE completed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get average of payment_method by payment_method from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(payment_method) AS average_payment_method FROM education.assignments GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with amount > 13.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE amount > 13;", "sql": null}, {"role": "user", "content": "Show me the count of assignments grouped by traded_at.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, COUNT(*) AS count FROM education.assignments GROUP BY traded_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n title character varying(256) NOT NULL,\n cost smallint,\n video_url varchar NOT NULL,\n reserved character varying(64) NOT NULL,\n discount smallint,\n brand text\n)\n\nCREATE TABLE education.assignments (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n amount bigint,\n payment_method char,\n seller_id character varying(128) -- identifier for seller,\n approval_status char,\n department_id text -- reference to departments.user_id,\n student_id integer NOT NULL -- reference to students.id,\n FOREIGN KEY (department_id) REFERENCES departments(user_id),\n FOREIGN KEY (student_id) REFERENCES students(id)\n)\n\nCREATE TABLE education.departments (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n created_at timestamp without time zone,\n email character varying(64),\n token character varying(256),\n website char,\n nationality character varying(64) NOT NULL,\n age text NOT NULL\n)\n\nCREATE TABLE education.students (\n id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n website varchar,\n salt character varying(128)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve student_id, traded_at, token, email showing the relationship between assignments and departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.token, departments.email FROM education.assignments JOIN education.departments ON assignments.department_id = departments.user_id;", "sql": null}, {"role": "user", "content": "Arrange the results with student_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.token, departments.email FROM education.assignments JOIN education.departments ON assignments.department_id = departments.user_id ORDER BY student_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Get all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Order the output by event_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY event_id ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY event_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve zip_code, address, membership_level for every like.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, address, membership_level FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Find likes where website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, address, membership_level FROM socialmedia.likes WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of likes in each website category.", "sql": null}, {"role": "assistant", "content": "SELECT website, COUNT(*) AS count FROM socialmedia.likes GROUP BY website ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_active, status, zip_code for every like.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, status, zip_code FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "List likes that have zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, status, zip_code FROM socialmedia.likes WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group likes by last_active and show the sum of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, SUM(updated_at) AS sum_updated_at FROM socialmedia.likes GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get users that match zip_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE zip_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many users are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.users GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Get email, event_id, accessibility, type by joining users with events.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.accessibility, events.type FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.address_id;", "sql": null}, {"role": "user", "content": "Calculate count of email for each zip_code in users.", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(email) AS count_email FROM socialmedia.users GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve password_hash, zip_code, status for every user.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, zip_code, status FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, zip_code, status FROM socialmedia.users WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group users by avatar and show the average of zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, AVERAGE(zip_code) AS average_zip_code FROM socialmedia.users GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, updated_at, event_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, event_id FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me updated_at, status, name, created_at from users and their related events.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, event_id, events.name, events.created_at FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.address_id;", "sql": null}, {"role": "user", "content": "Can you order these by website ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, event_id, events.name, events.created_at FROM socialmedia.users JOIN socialmedia.events ON users.event_id = events.address_id ORDER BY website ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Can you order these by event_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes ORDER BY event_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of likes in each event_id category.", "sql": null}, {"role": "assistant", "content": "SELECT event_id, COUNT(*) AS count FROM socialmedia.likes GROUP BY event_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "List last_active, zip_code, address from likes.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, address FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Show the results sorted by membership_level descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, address FROM socialmedia.likes ORDER BY membership_level DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, zip_code, address FROM socialmedia.likes ORDER BY membership_level DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n accessibility varchar NOT NULL,\n timezone character varying(64) NOT NULL,\n type char,\n address_line1 varchar,\n name character varying(128)\n)\n\nCREATE TABLE socialmedia.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n updated_at date,\n password_hash character varying(128),\n website character varying(128),\n zip_code char NOT NULL,\n email character varying(128) NOT NULL,\n avatar text,\n status text,\n event_id text -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)\n\nCREATE TABLE socialmedia.likes (\n customer_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n nationality text,\n status character varying(256),\n membership_level character varying(128),\n address character varying(64) NOT NULL,\n website varchar,\n zip_code varchar NOT NULL,\n event_id text NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all likes.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes;", "sql": null}, {"role": "user", "content": "Get all likes created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.likes WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get average of address by membership_level from likes.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, AVERAGE(address) AS average_address FROM socialmedia.likes GROUP BY membership_level;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.bookings;", "sql": null}, {"role": "user", "content": "Retrieve bookings where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.bookings WHERE cancelled_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of bookings across different cancelled_at values.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM retail.bookings GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Get all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members;", "sql": null}, {"role": "user", "content": "Arrange the results with address in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members ORDER BY address DESC;", "sql": null}, {"role": "user", "content": "Tally up members by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM retail.members GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "List created_at, booking_id, updated_at from members.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, booking_id, updated_at FROM retail.members;", "sql": null}, {"role": "user", "content": "List members that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, booking_id, updated_at FROM retail.members WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by booking_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, booking_id, updated_at FROM retail.members WHERE created_at > '2023-01-01' ORDER BY booking_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, created_at, username for all members.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, username FROM retail.members;", "sql": null}, {"role": "user", "content": "Show me members with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, username FROM retail.members WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of members in each address category.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM retail.members GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve birth_date, booking_id, address for every member.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, booking_id, address FROM retail.members;", "sql": null}, {"role": "user", "content": "List members that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, booking_id, address FROM retail.members WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by username descending.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, booking_id, address FROM retail.members WHERE created_at > '2023-01-01' ORDER BY username DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "What are the traded_at, amount, card_type of each booking?", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, amount, card_type FROM retail.bookings;", "sql": null}, {"role": "user", "content": "List card_type, payment_status, address, updated_at for each booking along with their member information.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, amount, card_type, members.address, members.updated_at FROM retail.bookings JOIN retail.members ON bookings.member_id = members.user_id;", "sql": null}, {"role": "user", "content": "Show me the count of bookings grouped by total.", "sql": null}, {"role": "assistant", "content": "SELECT total, COUNT(*) AS count FROM retail.bookings GROUP BY total ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "List all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.bookings;", "sql": null}, {"role": "user", "content": "Get bookings that match amount > 47.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.bookings WHERE amount > 47;", "sql": null}, {"role": "user", "content": "Get the distribution of bookings across different delivery_status values.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM retail.bookings GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members;", "sql": null}, {"role": "user", "content": "Retrieve members where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members WHERE created_at > '2023-01-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Display all members.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members;", "sql": null}, {"role": "user", "content": "Show me members that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.members WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Tally up members by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM retail.members GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE retail.members (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n username character varying(128),\n birth_date date,\n address character varying(128),\n booking_id integer -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)\n\nCREATE TABLE retail.bookings (\n id integer PRIMARY KEY -- unique identifier,\n traded_at date,\n cancelled_at date,\n payment_status character varying(128),\n card_type char,\n amount numeric,\n delivery_status char,\n currency character varying(128),\n total numeric NOT NULL,\n member_id integer -- reference to members.user_id,\n FOREIGN KEY (member_id) REFERENCES members(user_id)\n)", "conversations": [{"role": "user", "content": "Get all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM retail.bookings;", "sql": null}, {"role": "user", "content": "What delivery_status, card_type, username, address do we have for bookings and their associated members?", "sql": null}, {"role": "assistant", "content": "SELECT *, members.username, members.address FROM retail.bookings JOIN retail.members ON bookings.member_id = members.user_id;", "sql": null}, {"role": "user", "content": "Count the number of bookings in each cancelled_at category.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, COUNT(*) AS count FROM retail.bookings GROUP BY cancelled_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "List all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Get facilities that match address_line1 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities WHERE address_line1 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up facilities by user_id.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM realestate.facilities GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Can you order these by capacity descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities ORDER BY capacity DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve capacity, updated_at, address_line1 for every facilitie.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, updated_at, address_line1 FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "List facilities that have description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, updated_at, address_line1 FROM realestate.facilities WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of category for each capacity in facilities.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, SUM(category) AS sum_category FROM realestate.facilities GROUP BY capacity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Get capacity, latitude, created_at from all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, created_at FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Show me category, address_line1, state, last_active from facilities and their related users.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, created_at, users.state, users.last_active FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, created_at, users.state, users.last_active FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, address_line1, last_active, token showing the relationship between facilities and users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.last_active, users.token FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Sort the results by latitude ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.last_active, users.token FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id ORDER BY latitude ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me store_id, address_line1, description for all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, address_line1, description FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Retrieve description, address_line1, state, token showing the relationship between facilities and users.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, address_line1, description, users.state, users.token FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Get the distribution of facilities across different category values.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM realestate.facilities GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "What category, created_at, last_active, state do we have for facilities and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT *, users.last_active, users.state FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.last_active, users.state FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve user_id, address_line1, category for every facilitie.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, address_line1, category FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Can you order these by category ascending?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, address_line1, category FROM realestate.facilities ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, address_line1, category FROM realestate.facilities ORDER BY category ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve store_id, capacity, user_id for every facilitie.", "sql": null}, {"role": "assistant", "content": "SELECT store_id, capacity, user_id FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "What created_at, address_line1, state, token do we have for facilities and their associated users?", "sql": null}, {"role": "assistant", "content": "SELECT store_id, capacity, user_id, users.state, users.token FROM realestate.facilities JOIN realestate.users ON facilities.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "How many facilities are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM realestate.facilities GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.facilities (\n store_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n updated_at date,\n latitude text,\n capacity character varying(128),\n address_line1 char,\n category text,\n description character varying(64),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE realestate.users (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n state character varying(64),\n token character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me capacity, latitude, description for all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, description FROM realestate.facilities;", "sql": null}, {"role": "user", "content": "Find facilities created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, description FROM realestate.facilities WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Return just 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, latitude, description FROM realestate.facilities WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, currency, payment_status for all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, currency, payment_status FROM banking.reservations;", "sql": null}, {"role": "user", "content": "List reservations with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, currency, payment_status FROM banking.reservations WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate average of currency for each payment_method in reservations.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(currency) AS average_currency FROM banking.reservations GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients;", "sql": null}, {"role": "user", "content": "Show me patients with billin_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients WHERE billin_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by token ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients WHERE billin_id LIKE 'A%' ORDER BY token ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients;", "sql": null}, {"role": "user", "content": "List token, country, amount, payee_id for each patient along with their billing information.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.amount, billing.payee_id FROM banking.patients JOIN banking.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.amount, billing.payee_id FROM banking.patients JOIN banking.billing ON patients.billin_id = billing.id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get billin_id, created_at, payment_method from all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, payment_method FROM banking.reservations;", "sql": null}, {"role": "user", "content": "List reservations that have payment_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, payment_method FROM banking.reservations WHERE payment_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, payment_method FROM banking.reservations WHERE payment_status LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Display all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.billing;", "sql": null}, {"role": "user", "content": "Show me description, payee_id, currency, amount from billing and their related reservations.", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.currency, reservations.amount FROM banking.billing JOIN banking.reservations ON billing.reservation_id = reservations.id;", "sql": null}, {"role": "user", "content": "Can you order these by amount descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, reservations.currency, reservations.amount FROM banking.billing JOIN banking.reservations ON billing.reservation_id = reservations.id ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients;", "sql": null}, {"role": "user", "content": "Show me patients with salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.patients WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many patients are there per first_name?", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM banking.patients GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.billing;", "sql": null}, {"role": "user", "content": "List billing with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.billing WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Group billing by updated_at and show the max of reservation_id.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(reservation_id) AS max_reservation_id FROM banking.billing GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Display all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.reservations;", "sql": null}, {"role": "user", "content": "Retrieve reservations where payment_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.reservations WHERE payment_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.reservations WHERE payment_status LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "List all reservations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.reservations;", "sql": null}, {"role": "user", "content": "Can you order these by currency ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.reservations ORDER BY currency ASC;", "sql": null}, {"role": "user", "content": "Get sum of buyer_id by created_at from reservations.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(buyer_id) AS sum_buyer_id FROM banking.reservations GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.billing (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n status varchar,\n amount decimal,\n description text,\n payee_id character varying(64) NOT NULL -- identifier for payee,\n reservation_id integer NOT NULL -- reference to reservations.id,\n FOREIGN KEY (reservation_id) REFERENCES reservations(id)\n)\n\nCREATE TABLE banking.reservations (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n payment_method text NOT NULL,\n buyer_id varchar -- identifier for buyer,\n payment_status varchar NOT NULL,\n amount decimal,\n currency varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)\n\nCREATE TABLE banking.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n salt char,\n country character varying(64),\n first_name text NOT NULL,\n token text,\n profile_picture_url varchar,\n billin_id text NOT NULL -- reference to billing.id,\n FOREIGN KEY (billin_id) REFERENCES billing(id)\n)", "conversations": [{"role": "user", "content": "Get billin_id, created_at, first_name from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, first_name FROM banking.patients;", "sql": null}, {"role": "user", "content": "What token, salt, status, updated_at do we have for patients and their associated billing?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, created_at, first_name, billing.status, billing.updated_at FROM banking.patients JOIN banking.billing ON patients.billin_id = billing.id;", "sql": null}, {"role": "user", "content": "What is the sum profile_picture_url for each billin_id in patients?", "sql": null}, {"role": "assistant", "content": "SELECT billin_id, SUM(profile_picture_url) AS sum_profile_picture_url FROM banking.patients GROUP BY billin_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Show me id, is_verified, city for all audits.", "sql": null}, {"role": "assistant", "content": "SELECT id, is_verified, city FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get all audits created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT id, is_verified, city FROM finance.audits WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT id, is_verified, city FROM finance.audits WHERE created_at > '2023-12-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Get city, is_verified, customer_id from all audits.", "sql": null}, {"role": "assistant", "content": "SELECT city, is_verified, customer_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Order the output by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT city, is_verified, customer_id FROM finance.audits ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT city, is_verified, customer_id FROM finance.audits ORDER BY language DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by language ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE id LIKE 'A%' ORDER BY language ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits where gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of audits in each gender category.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM finance.audits GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Find transactions where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of transactions grouped by status.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM finance.transactions GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n payment_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payment_date timestamp,\n approval_status character varying(256) NOT NULL,\n invoice_number character varying(256),\n vendor_id varchar -- identifier for vendor,\n credit character varying(64),\n amount numeric\n)\n\nCREATE TABLE finance.transactions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n traded_at date,\n status character varying(128),\n currency char,\n fee character varying(64),\n subtotal numeric,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)\n\nCREATE TABLE finance.customers (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n display_name character varying(256),\n bio character varying(64) NOT NULL,\n password_hash character varying(64),\n full_name varchar,\n website character varying(256),\n account_status character varying(128)\n)\n\nCREATE TABLE finance.audits (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n gender varchar,\n username character varying(64) NOT NULL,\n city varchar NOT NULL,\n is_verified boolean,\n language char,\n customer_id text NOT NULL -- reference to customers.user_id,\n FOREIGN KEY (customer_id) REFERENCES customers(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by gender ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with city in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY city ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n payee_id char NOT NULL -- identifier for payee,\n invoice_number char,\n exchange_rate char,\n vendor_id character varying(128) NOT NULL,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)\n\nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status character varying(256),\n seller_id text -- identifier for seller,\n user_id text\n)\n\nCREATE TABLE finance.customers (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n address varchar,\n zip_code character varying(128),\n website character varying(64) NOT NULL,\n country varchar,\n username character varying(128)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n balance numeric(38,14),\n reference_number character varying(64) NOT NULL,\n approval_status char,\n customer_id character varying(256)\n)\n\nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n status text,\n discount decimal NOT NULL,\n currency char,\n loan_id text -- reference to loans.payment_id,\n FOREIGN KEY (loan_id) REFERENCES loans(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with investment_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans ORDER BY investment_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n payee_id char NOT NULL -- identifier for payee,\n invoice_number char,\n exchange_rate char,\n vendor_id character varying(128) NOT NULL,\n investment_id text -- reference to investments.invoice_id,\n FOREIGN KEY (investment_id) REFERENCES investments(invoice_id)\n)\n\nCREATE TABLE finance.investments (\n invoice_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp without time zone,\n payment_status text NOT NULL,\n delivery_status character varying(256),\n seller_id text -- identifier for seller,\n user_id text\n)\n\nCREATE TABLE finance.customers (\n person_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n address varchar,\n zip_code character varying(128),\n website character varying(64) NOT NULL,\n country varchar,\n username character varying(128)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n balance numeric(38,14),\n reference_number character varying(64) NOT NULL,\n approval_status char,\n customer_id character varying(256)\n)\n\nCREATE TABLE finance.transactions (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n status text,\n discount decimal NOT NULL,\n currency char,\n loan_id text -- reference to loans.payment_id,\n FOREIGN KEY (loan_id) REFERENCES loans(payment_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "List transactions that have discount > 64.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE discount > 64;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE discount > 64 LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Show me billing with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of billing grouped by parent_id.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, COUNT(*) AS count FROM healthcare.billing GROUP BY parent_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List image_url, prescription_id, customer_id, payer_id for each billing along with their prescription information.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.customer_id, prescriptions.payer_id FROM healthcare.billing JOIN healthcare.prescriptions ON billing.prescription_id = prescriptions.id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.customer_id, prescriptions.payer_id FROM healthcare.billing JOIN healthcare.prescriptions ON billing.prescription_id = prescriptions.id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List patient_id, currency, due_date from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, currency, due_date FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get customer_id, payer_id, full_name, phone by joining prescriptions with patients.", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, currency, due_date, patients.full_name, patients.phone FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Count the number of prescriptions in each due_date category.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Show me all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE body LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List due_date, patient_id, currency from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, patient_id, currency FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "List currency, payer_id, billin_id, phone for each prescription along with their patient information.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, patient_id, currency, patients.billin_id, patients.phone FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Show me sum of customer_id grouped by payer_id for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, SUM(customer_id) AS sum_customer_id FROM healthcare.prescriptions GROUP BY payer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve due_date, patient_id, username, status showing the relationship between prescriptions and patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.username, patients.status FROM healthcare.prescriptions JOIN healthcare.patients ON prescriptions.patient_id = patients.employee_id;", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "List due_date, payer_id, patient_id from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payer_id, patient_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Sort the results by currency ascending.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payer_id, patient_id FROM healthcare.prescriptions ORDER BY currency ASC;", "sql": null}, {"role": "user", "content": "How many prescriptions are there per currency?", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where phone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE phone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by username ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE phone LIKE 'A%' ORDER BY username ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Can you order these by currency descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE due_date BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.prescriptions (\n id text PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n payer_id character varying(128),\n customer_id character varying(64) -- identifier for customer,\n currency character varying(64) NOT NULL,\n patient_id text NOT NULL -- reference to patients.employee_id,\n FOREIGN KEY (patient_id) REFERENCES patients(employee_id)\n)\n\nCREATE TABLE healthcare.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n status character varying(64) NOT NULL,\n username character varying(128) NOT NULL,\n phone char,\n full_name char NOT NULL,\n billin_id text -- reference to billing.content_id,\n FOREIGN KEY (billin_id) REFERENCES billing(content_id)\n)\n\nCREATE TABLE healthcare.billing (\n content_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at timestamp without time zone,\n body character varying(128) NOT NULL,\n image_url character varying(64),\n parent_id character varying(128) -- identifier for parent,\n thumbnail text NOT NULL,\n shares char NOT NULL,\n prescription_id text -- reference to prescriptions.id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(id)\n)", "conversations": [{"role": "user", "content": "Get created_at, billin_id, username from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, billin_id, username FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have username LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, billin_id, username FROM healthcare.patients WHERE username LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM healthcare.patients GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by price descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY price DESC;", "sql": null}, {"role": "user", "content": "Get sum of price by available from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT available, SUM(price) AS sum_price FROM education.assignments GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Can you order these by parent_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments ORDER BY parent_id DESC;", "sql": null}, {"role": "user", "content": "Group departments by created_at and show the sum of subject.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(subject) AS sum_subject FROM education.departments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List media_url, score, parent_id from departments.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, score, parent_id FROM education.departments;", "sql": null}, {"role": "user", "content": "List created_at, parent_id, discount, created_at for each department along with their assignment information.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, score, parent_id, assignments.discount, assignments.created_at FROM education.departments JOIN education.assignments ON departments.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, score, parent_id, assignments.discount, assignments.created_at FROM education.departments JOIN education.assignments ON departments.assignment_id = assignments.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of departments in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM education.departments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, updated_at, subject for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, subject FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, updated_at, subject FROM education.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate max of parent_id for each score in departments.", "sql": null}, {"role": "assistant", "content": "SELECT score, MAX(parent_id) AS max_parent_id FROM education.departments GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "List reserved, department_id, expires_at from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, department_id, expires_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments from last week.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, department_id, expires_at FROM education.assignments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, department_id, expires_at FROM education.assignments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with discount in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE created_at > '2023-01-01' ORDER BY discount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Show me all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY media_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Retrieve featured_rank, available, department_id for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, available, department_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me created_at, reserved, parent_id, created_at from assignments and their related departments.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, available, department_id, departments.parent_id, departments.created_at FROM education.assignments JOIN education.departments ON assignments.department_id = departments.id;", "sql": null}, {"role": "user", "content": "How many assignments are there per available?", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM education.assignments GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.departments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp without time zone,\n parent_id character varying(64),\n media_url character varying(64),\n subject character varying(64) NOT NULL,\n score character varying(128),\n assignment_id text -- reference to assignments.id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id)\n)\n\nCREATE TABLE education.assignments (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n expires_at timestamp,\n discount smallint NOT NULL,\n price numeric(38,14),\n reserved varchar NOT NULL,\n available text,\n featured_rank character varying(256) NOT NULL,\n thumbnail_url character varying(256),\n department_id text -- reference to departments.id,\n FOREIGN KEY (department_id) REFERENCES departments(id)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve score, assignment_id, discount, thumbnail_url showing the relationship between departments and assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.discount, assignments.thumbnail_url FROM education.departments JOIN education.assignments ON departments.assignment_id = assignments.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by score descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.discount, assignments.thumbnail_url FROM education.departments JOIN education.assignments ON departments.assignment_id = assignments.id ORDER BY score DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many users are there per profile_picture_url?", "sql": null}, {"role": "assistant", "content": "SELECT profile_picture_url, COUNT(*) AS count FROM tradingplatform.users GROUP BY profile_picture_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, created_at, language for every user.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, language FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, created_at, language FROM tradingplatform.users WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "What is the max state for each asset_id in users?", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, MAX(state) AS max_state FROM tradingplatform.users GROUP BY asset_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Get order_id, title, updated_at from all assets.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, title, updated_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, title, updated_at FROM tradingplatform.assets WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group assets by image_url and show the average of title.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, AVERAGE(title) AS average_title FROM tradingplatform.assets GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve order_id, reserved, image_url for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, reserved, image_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, reserved, image_url FROM tradingplatform.assets WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of assets in each reserved category.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM tradingplatform.assets GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me title, order_id, image_url for all assets.", "sql": null}, {"role": "assistant", "content": "SELECT title, order_id, image_url FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by title ascending.", "sql": null}, {"role": "assistant", "content": "SELECT title, order_id, image_url FROM tradingplatform.assets ORDER BY title ASC;", "sql": null}, {"role": "user", "content": "Count the number of assets in each rating category.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM tradingplatform.assets GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Can you order these by asset_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY asset_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of users in each state category.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM tradingplatform.users GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List assets with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users with state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE state LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Get state, asset_id, profile_picture_url from all users.", "sql": null}, {"role": "assistant", "content": "SELECT state, asset_id, profile_picture_url FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by profile_picture_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT state, asset_id, profile_picture_url FROM tradingplatform.users ORDER BY profile_picture_url ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with phone in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT state, asset_id, profile_picture_url FROM tradingplatform.users ORDER BY phone ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n user_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n state char NOT NULL,\n api_key char NOT NULL,\n language character varying(128) NOT NULL,\n phone character varying(128),\n profile_picture_url varchar,\n asset_id integer -- reference to assets.product_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n product_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n price bigint,\n reserved character varying(256),\n image_url varchar,\n rating char NOT NULL,\n title text,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n traded_at timestamp,\n discount bigint NOT NULL,\n customer_id varchar -- identifier for customer,\n account_id character varying(128) NOT NULL -- identifier for account,\n approval_status character varying(64),\n payment_method character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Find assets created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by order_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE updated_at > '2023-12-01' ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve subcategory, media_url, order_item_id for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, media_url, order_item_id FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory with tax_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, media_url, order_item_id FROM e-commerce.inventory WHERE tax_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of order_item_id grouped by published_at for inventory.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, AVERAGE(order_item_id) AS average_order_item_id FROM e-commerce.inventory GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "List media_url, published_at, tax_rate from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, published_at, tax_rate FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, published_at, tax_rate FROM e-commerce.inventory WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by order_item_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT media_url, published_at, tax_rate FROM e-commerce.inventory WHERE thumbnail_url LIKE 'A%' ORDER BY order_item_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "List views, inventor_id, featured_rank from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT views, inventor_id, featured_rank FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT views, inventor_id, featured_rank FROM e-commerce.order_items ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM e-commerce.order_items GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me published_at, subcategory, views, created_at from inventory and their related order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.views, order_items.created_at FROM e-commerce.inventory JOIN e-commerce.order_items ON inventory.order_item_id = order_items.item_id;", "sql": null}, {"role": "user", "content": "How many inventory are there per tax_rate?", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, COUNT(*) AS count FROM e-commerce.inventory GROUP BY tax_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Get order_items that match thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by views ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE thumbnail_url LIKE 'A%' ORDER BY views ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate max of tax_rate for each published_at in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, MAX(tax_rate) AS max_tax_rate FROM e-commerce.inventory GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "What are the views, created_at, published_at of each order_item?", "sql": null}, {"role": "assistant", "content": "SELECT views, created_at, published_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "List order_items that have views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT views, created_at, published_at FROM e-commerce.order_items WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the sum inventor_id for each published_at in order_items?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, SUM(inventor_id) AS sum_inventor_id FROM e-commerce.order_items GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Show me all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by thumbnail_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE published_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY thumbnail_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Arrange the results with order_item_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY order_item_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY thumbnail_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n subcategory char,\n media_url varchar,\n thumbnail_url text NOT NULL,\n tax_rate character varying(128),\n order_item_id integer -- reference to order_items.item_id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(item_id)\n)\n\nCREATE TABLE e-commerce.order_items (\n item_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp without time zone,\n created_at date,\n featured_rank text NOT NULL,\n views character varying(64),\n thumbnail_url character varying(64),\n inventor_id text -- reference to inventory.item_id,\n FOREIGN KEY (inventor_id) REFERENCES inventory(item_id)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Retrieve order_items where thumbnail_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE thumbnail_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up order_items by thumbnail_url.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, COUNT(*) AS count FROM e-commerce.order_items GROUP BY thumbnail_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Find purchases between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by processed_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY processed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the updated_at, payment_method, client_id of each purchase?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_method, client_id FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, payment_method, client_id FROM sports.purchases ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Tally up purchases by approval_status.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM sports.purchases GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Retrieve payment_method, client_id, birth_date, token showing the relationship between purchases and clients.", "sql": null}, {"role": "assistant", "content": "SELECT *, clients.birth_date, clients.token FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "Calculate count of processed_at for each updated_at in purchases.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(processed_at) AS count_processed_at FROM sports.purchases GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, client_id, approval_status for every purchase.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, client_id, approval_status FROM sports.purchases;", "sql": null}, {"role": "user", "content": "List payment_method, approval_status, nationality, updated_at for each purchase along with their client information.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, client_id, approval_status, clients.nationality, clients.updated_at FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "Calculate average of transaction_id for each payment_method in purchases.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(transaction_id) AS average_transaction_id FROM sports.purchases GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "List all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Get all purchases between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases WHERE processed_at BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Order the output by subtotal ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases ORDER BY subtotal ASC;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM sports.purchases ORDER BY subtotal ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "List transaction_id, processed_at, client_id from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, processed_at, client_id FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Retrieve subtotal, approval_status, website, birth_date showing the relationship between purchases and clients.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, processed_at, client_id, clients.website, clients.birth_date FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, processed_at, client_id, clients.website, clients.birth_date FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me processed_at, payment_method, updated_at for all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_method, updated_at FROM sports.purchases;", "sql": null}, {"role": "user", "content": "List processed_at, subtotal, is_active, nationality for each purchase along with their client information.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_method, updated_at, clients.is_active, clients.nationality FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "Arrange the results with transaction_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payment_method, updated_at, clients.is_active, clients.nationality FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id ORDER BY transaction_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, updated_at, client_id for every purchase.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, client_id FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Show me subtotal, processed_at, updated_at, nationality from purchases and their related clients.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, client_id, clients.updated_at, clients.nationality FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, updated_at, client_id, clients.updated_at, clients.nationality FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE sports.purchases (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n updated_at date,\n subtotal numeric(38,14),\n approval_status character varying(256) NOT NULL,\n payment_method character varying(256) NOT NULL,\n client_id integer NOT NULL -- reference to clients.customer_id,\n FOREIGN KEY (client_id) REFERENCES clients(customer_id)\n)\n\nCREATE TABLE sports.clients (\n customer_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n birth_date date,\n nationality text,\n website character varying(128),\n token character varying(256) NOT NULL,\n is_active boolean NOT NULL\n)", "conversations": [{"role": "user", "content": "List processed_at, subtotal, approval_status from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, subtotal, approval_status FROM sports.purchases;", "sql": null}, {"role": "user", "content": "Show me subtotal, updated_at, nationality, birth_date from purchases and their related clients.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, subtotal, approval_status, clients.nationality, clients.birth_date FROM sports.purchases JOIN sports.clients ON purchases.client_id = clients.customer_id;", "sql": null}, {"role": "user", "content": "What is the average subtotal for each payment_method in purchases?", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, AVERAGE(subtotal) AS average_subtotal FROM sports.purchases GROUP BY payment_method;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Sort the results by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY exchange_rate DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve payer_id, exchange_rate, cancelled_at, delivery_status showing the relationship between accounts and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.cancelled_at, transactions.delivery_status FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "What is the min payment_id for each processed_at in accounts?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, MIN(payment_id) AS min_payment_id FROM finance.accounts GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get reconciliation_status, transaction_id, exchange_rate from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, transaction_id, exchange_rate FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by processed_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, transaction_id, exchange_rate FROM finance.accounts ORDER BY processed_at DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different processed_at values.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.accounts GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Retrieve all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List accounts that have payer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payer_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get payment_id, payer_id, processed_at from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, payer_id, processed_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Can you order these by payment_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, payer_id, processed_at FROM finance.accounts ORDER BY payment_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with payer_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, payer_id, processed_at FROM finance.accounts ORDER BY payer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve transaction_id, payment_id, discount, delivery_status showing the relationship between accounts and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.discount, transactions.delivery_status FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.discount, transactions.delivery_status FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Retrieve exchange_rate, payer_id, cancelled_at, buyer_id showing the relationship between accounts and transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.cancelled_at, transactions.buyer_id FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different exchange_rate values.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM finance.accounts GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "List exchange_rate, reconciliation_status, transaction_id from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, reconciliation_status, transaction_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me processed_at, transaction_id, discount, buyer_id from accounts and their related transactions.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, reconciliation_status, transaction_id, transactions.discount, transactions.buyer_id FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Arrange the results with reconciliation_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, reconciliation_status, transaction_id, transactions.discount, transactions.buyer_id FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id ORDER BY reconciliation_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Show me payment_id, reconciliation_status, cancelled_at, traded_at from accounts and their related transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.cancelled_at, transactions.traded_at FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different reconciliation_status values.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, COUNT(*) AS count FROM finance.accounts GROUP BY reconciliation_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.investments (\n post_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n content character varying(128) NOT NULL,\n text character varying(256),\n keywords varchar\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp without time zone,\n reconciliation_status char,\n payer_id char NOT NULL -- identifier for payer,\n exchange_rate varchar NOT NULL,\n transaction_id text NOT NULL -- reference to transactions.order_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(order_id)\n)\n\nCREATE TABLE finance.transactions (\n order_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n traded_at date,\n discount integer,\n delivery_status text,\n buyer_id varchar NOT NULL -- identifier for buyer\n)", "conversations": [{"role": "user", "content": "List all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "List payer_id, payment_id, discount, traded_at for each account along with their transaction information.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.discount, transactions.traded_at FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.discount, transactions.traded_at FROM finance.accounts JOIN finance.transactions ON accounts.transaction_id = transactions.order_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "Get msrp, updated_at, available from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, updated_at, available FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, updated_at, available FROM e-commerce.inventory WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up inventory by available.", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(*) AS count FROM e-commerce.inventory GROUP BY available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "List id, available, msrp from products.", "sql": null}, {"role": "assistant", "content": "SELECT id, available, msrp FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT id, available, msrp FROM e-commerce.products WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of products in each expires_at category.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.products GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews where edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by reply_to_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at > '2023-01-01' ORDER BY reply_to_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "List available, created_at, expires_at from products.", "sql": null}, {"role": "assistant", "content": "SELECT available, created_at, expires_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT available, created_at, expires_at FROM e-commerce.products WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group products by msrp and show the max of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, MAX(created_at) AS max_created_at FROM e-commerce.products GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me expires_at, media_url, id for all products.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, id FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, id FROM e-commerce.products WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, media_url, id FROM e-commerce.products WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the backorder, item_id, msrp of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, item_id, msrp FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, item_id, msrp FROM e-commerce.inventory ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by price ascending?", "sql": null}, {"role": "assistant", "content": "SELECT backorder, item_id, msrp FROM e-commerce.inventory ORDER BY price ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me available, published_at, updated_at for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT available, published_at, updated_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory with subcategory LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT available, published_at, updated_at FROM e-commerce.inventory WHERE subcategory LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the count available for each msrp in inventory?", "sql": null}, {"role": "assistant", "content": "SELECT msrp, COUNT(available) AS count_available FROM e-commerce.inventory GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me reply_to_id, user_id, edited_at for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, user_id, edited_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Sort the results by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, user_id, edited_at FROM e-commerce.reviews ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of reviews in each edited_at category.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM e-commerce.reviews GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "List likes, reply_to_id, media_url from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT likes, reply_to_id, media_url FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT likes, reply_to_id, media_url FROM e-commerce.reviews WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with reply_to_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT likes, reply_to_id, media_url FROM e-commerce.reviews WHERE edited_at > '2023-01-01' ORDER BY reply_to_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n media_url character varying(128),\n likes text NOT NULL,\n user_id character varying(128) -- identifier for user,\n reply_to_id character varying(256) NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n created_at timestamp,\n media_url varchar,\n available character varying(64) NOT NULL,\n msrp character varying(128)\n)\n\nCREATE TABLE e-commerce.users (\n id character varying(64) NOT NULL -- unique identifier,\n joined_at timestamp,\n first_name varchar,\n salt character varying(256),\n address character varying(256) NOT NULL,\n token text\n)\n\nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n published_at date,\n updated_at date,\n msrp character varying(256),\n available varchar,\n price bigint,\n subcategory text,\n backorder character varying(256)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by available descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY available DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Sort the results by status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by token descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing ORDER BY token DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me city, updated_at, token for all billing.", "sql": null}, {"role": "assistant", "content": "SELECT city, updated_at, token FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Order the output by joined_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT city, updated_at, token FROM healthcare.billing ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT city, updated_at, token FROM healthcare.billing ORDER BY joined_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve account_status, first_name, email, patient_id showing the relationship between patients and billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.email, billing.patient_id FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.user_id;", "sql": null}, {"role": "user", "content": "Calculate count of gender for each first_name in patients.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(gender) AS count_gender FROM healthcare.patients GROUP BY first_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve gender, billin_id, last_active for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT gender, billin_id, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT gender, billin_id, last_active FROM healthcare.patients WHERE last_active > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by gender ascending.", "sql": null}, {"role": "assistant", "content": "SELECT gender, billin_id, last_active FROM healthcare.patients WHERE last_active > '2023-12-01' ORDER BY gender ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "List api_key, status, first_name from patients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, status, first_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Can you order these by first_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, status, first_name FROM healthcare.patients ORDER BY first_name ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, status, first_name FROM healthcare.patients ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me status, account_status, joined_at, token from patients and their related billing.", "sql": null}, {"role": "assistant", "content": "SELECT *, billing.joined_at, billing.token FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.user_id;", "sql": null}, {"role": "user", "content": "Calculate average of billin_id for each gender in patients.", "sql": null}, {"role": "assistant", "content": "SELECT gender, AVERAGE(billin_id) AS average_billin_id FROM healthcare.patients GROUP BY gender;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Show me api_key, status, gender for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, status, gender FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve first_name, billin_id, token, patient_id showing the relationship between patients and billing.", "sql": null}, {"role": "assistant", "content": "SELECT api_key, status, gender, billing.token, billing.patient_id FROM healthcare.patients JOIN healthcare.billing ON patients.billin_id = billing.user_id;", "sql": null}, {"role": "user", "content": "Count the number of patients in each first_name category.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, COUNT(*) AS count FROM healthcare.patients GROUP BY first_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "What are the last_active, first_name, gender of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, first_name, gender FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, first_name, gender FROM healthcare.patients WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, first_name, gender FROM healthcare.patients WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve status, last_active, api_key for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, api_key FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, api_key FROM healthcare.patients WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by account_status descending?", "sql": null}, {"role": "assistant", "content": "SELECT status, last_active, api_key FROM healthcare.patients WHERE gender LIKE 'A%' ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n status character varying(128),\n account_status character varying(256),\n gender character varying(256) NOT NULL,\n api_key char,\n first_name character varying(256),\n billin_id integer -- reference to billing.user_id,\n FOREIGN KEY (billin_id) REFERENCES billing(user_id)\n)\n\nCREATE TABLE healthcare.billing (\n user_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n updated_at date,\n email character varying(256) NOT NULL,\n status text NOT NULL,\n token character varying(64),\n city character varying(128) NOT NULL,\n patient_id integer NOT NULL -- reference to patients.customer_id,\n FOREIGN KEY (patient_id) REFERENCES patients(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve gender, first_name, api_key for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT gender, first_name, api_key FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match gender LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT gender, first_name, api_key FROM healthcare.patients WHERE gender LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up patients by gender.", "sql": null}, {"role": "assistant", "content": "SELECT gender, COUNT(*) AS count FROM healthcare.patients GROUP BY gender ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Show me parent_id, updated_at, likes for all posts.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, updated_at, likes FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by like_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, updated_at, likes FROM socialmedia.posts ORDER BY like_id DESC;", "sql": null}, {"role": "user", "content": "Calculate min of parent_id for each like_id in posts.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, MIN(parent_id) AS min_parent_id FROM socialmedia.posts GROUP BY like_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Get post_id, created_at, author_id from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, author_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with thumbnail in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, author_id FROM socialmedia.comments ORDER BY thumbnail DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by thumbnail descending.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, created_at, author_id FROM socialmedia.comments ORDER BY thumbnail DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Show me count of likes grouped by likes for posts.", "sql": null}, {"role": "assistant", "content": "SELECT likes, COUNT(likes) AS count_likes FROM socialmedia.posts GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Get like_id, parent_id, updated_at from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT like_id, parent_id, updated_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by parent_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT like_id, parent_id, updated_at FROM socialmedia.posts ORDER BY parent_id ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of like_id for each likes in posts.", "sql": null}, {"role": "assistant", "content": "SELECT likes, SUM(like_id) AS sum_like_id FROM socialmedia.posts GROUP BY likes;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "What content, created_at, updated_at, likes do we have for comments and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.updated_at, posts.likes FROM socialmedia.comments JOIN socialmedia.posts ON comments.post_id = posts.id;", "sql": null}, {"role": "user", "content": "Tally up comments by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM socialmedia.comments GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Show me thumbnail, author_id, text for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, author_id, text FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, author_id, text FROM socialmedia.comments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, author_id, text FROM socialmedia.comments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate min of thumbnail for each text in comments.", "sql": null}, {"role": "assistant", "content": "SELECT text, MIN(thumbnail) AS min_thumbnail FROM socialmedia.comments GROUP BY text;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of comments grouped by content.", "sql": null}, {"role": "assistant", "content": "SELECT content, COUNT(*) AS count FROM socialmedia.comments GROUP BY content ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "List media_url, parent_id, likes from posts.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, parent_id, likes FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Arrange the results with media_url in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, parent_id, likes FROM socialmedia.posts ORDER BY media_url DESC;", "sql": null}, {"role": "user", "content": "Show me count of media_url grouped by media_url for posts.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(media_url) AS count_media_url FROM socialmedia.posts GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n parent_id character varying(256),\n likes character varying(128),\n media_url character varying(128),\n like_id integer NOT NULL -- reference to likes.account_id,\n FOREIGN KEY (like_id) REFERENCES likes(account_id)\n)\n\nCREATE TABLE socialmedia.likes (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n reference_number character varying(64) NOT NULL,\n payee_id varchar NOT NULL,\n user_id character varying(64),\n category varchar NOT NULL,\n balance bigint\n)\n\nCREATE TABLE socialmedia.events (\n product_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n published_at date,\n popularity_score character varying(256) NOT NULL,\n name character varying(256),\n backorder character varying(256),\n featured_rank character varying(256)\n)\n\nCREATE TABLE socialmedia.comments (\n id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n text text NOT NULL,\n content varchar,\n thumbnail char,\n author_id character varying(128) NOT NULL -- identifier for author,\n post_id integer -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)", "conversations": [{"role": "user", "content": "Show me content, thumbnail, post_id for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, post_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, post_id FROM socialmedia.comments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT content, thumbnail, post_id FROM socialmedia.comments WHERE created_at > '2023-01-01' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Calculate count of gender for each is_active in users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, COUNT(gender) AS count_gender FROM socialmedia.users GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "List score, updated_at, parent_id from posts.", "sql": null}, {"role": "assistant", "content": "SELECT score, updated_at, parent_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "List posts with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT score, updated_at, parent_id FROM socialmedia.posts WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of posts grouped by author_id.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM socialmedia.posts GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate sum of last_name for each is_active in users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, SUM(last_name) AS sum_last_name FROM socialmedia.users GROUP BY is_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers that have quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group followers by total and show the min of payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT total, MIN(payment_method) AS min_payment_method FROM socialmedia.followers GROUP BY total;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show me users with is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Sort the results by is_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users WHERE is_active = TRUE ORDER BY is_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the gender, website, is_active of each user?", "sql": null}, {"role": "assistant", "content": "SELECT gender, website, is_active FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "List users that have id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT gender, website, is_active FROM socialmedia.users WHERE id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT gender, website, is_active FROM socialmedia.users WHERE id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get count of thumbnail by author_id from posts.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(thumbnail) AS count_thumbnail FROM socialmedia.posts GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Show me posts that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Can you order these by image_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by total descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY total DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with amount in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY amount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n total numeric NOT NULL,\n payment_method text,\n quantity character varying(256),\n exchange_rate varchar NOT NULL,\n amount numeric,\n customer_id char NOT NULL -- identifier for customer\n)\n\nCREATE TABLE socialmedia.users (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n last_name character varying(256),\n is_active bit,\n website text,\n gender character varying(128),\n api_key varchar NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n format char,\n thumbnail character varying(128) NOT NULL,\n image_url character varying(128) NOT NULL,\n score character varying(128),\n author_id character varying(128),\n parent_id char NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Get all items created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE published_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "What are the published_at, available, sku of each item?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, available, sku FROM government.items;", "sql": null}, {"role": "user", "content": "Order the output by available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, available, sku FROM government.items ORDER BY available ASC;", "sql": null}, {"role": "user", "content": "Sort the results by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, available, sku FROM government.items ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Show me category, sku, address_line2, created_at from items and their related addresses.", "sql": null}, {"role": "assistant", "content": "SELECT *, addresses.address_line2, addresses.created_at FROM government.items JOIN government.addresses ON items.addresse_id = addresses.venue_id;", "sql": null}, {"role": "user", "content": "Tally up items by category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM government.items GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Show me items with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE description LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Get all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Arrange the results with description in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Show me min of available grouped by published_at for items.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, MIN(available) AS min_available FROM government.items GROUP BY published_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Get all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Retrieve items where published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE published_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "List available, category, sku from items.", "sql": null}, {"role": "assistant", "content": "SELECT available, category, sku FROM government.items;", "sql": null}, {"role": "user", "content": "Get sku, available, latitude, created_at by joining items with addresses.", "sql": null}, {"role": "assistant", "content": "SELECT available, category, sku, addresses.latitude, addresses.created_at FROM government.items JOIN government.addresses ON items.addresse_id = addresses.venue_id;", "sql": null}, {"role": "user", "content": "Get sum of category by description from items.", "sql": null}, {"role": "assistant", "content": "SELECT description, SUM(category) AS sum_category FROM government.items GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "List items that have addresse_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE addresse_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE addresse_id LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Show me available, sku, category for all items.", "sql": null}, {"role": "assistant", "content": "SELECT available, sku, category FROM government.items;", "sql": null}, {"role": "user", "content": "Show me available, sku, latitude, address_line2 from items and their related addresses.", "sql": null}, {"role": "assistant", "content": "SELECT available, sku, category, addresses.latitude, addresses.address_line2 FROM government.items JOIN government.addresses ON items.addresse_id = addresses.venue_id;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT available, sku, category, addresses.latitude, addresses.address_line2 FROM government.items JOIN government.addresses ON items.addresse_id = addresses.venue_id ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.addresses (\n venue_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n location_lon char NOT NULL,\n address_line2 character varying(128) NOT NULL,\n latitude character varying(128)\n)\n\nCREATE TABLE government.items (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n category character varying(128),\n available varchar NOT NULL,\n description character varying(128),\n addresse_id text NOT NULL -- reference to addresses.venue_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(venue_id)\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items;", "sql": null}, {"role": "user", "content": "Show me items with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by category ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.items WHERE description LIKE 'A%' ORDER BY category ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get sum of edited_at by edited_at from messages.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, SUM(edited_at) AS sum_edited_at FROM socialmedia.messages GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "What are the author_id, image_url, edited_at of each message?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, image_url, edited_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, image_url, edited_at FROM socialmedia.messages WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of messages in each follower_id category.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Find messages where media_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE media_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE media_url LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the sum follower_id for each score in messages?", "sql": null}, {"role": "assistant", "content": "SELECT score, SUM(follower_id) AS sum_follower_id FROM socialmedia.messages GROUP BY score;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List score, media_url, language, salt for each message along with their follower information.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.language, followers.salt FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.person_id;", "sql": null}, {"role": "user", "content": "Calculate min of author_id for each image_url in messages.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MIN(author_id) AS min_author_id FROM socialmedia.messages GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "List post_id, edited_at, follower_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, edited_at, follower_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What follower_id, author_id, language, birth_date do we have for messages and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT post_id, edited_at, follower_id, followers.language, followers.birth_date FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.person_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by edited_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, edited_at, follower_id, followers.language, followers.birth_date FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.person_id ORDER BY edited_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE birth_date = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by group_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE birth_date = CURRENT_DATE - INTERVAL '1 day' ORDER BY group_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve last_login, group_id, salt for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, group_id, salt FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Arrange the results with nationality in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, group_id, salt FROM socialmedia.followers ORDER BY nationality DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, group_id, salt FROM socialmedia.followers ORDER BY nationality DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers with nationality LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE nationality LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group followers by password_hash and show the min of last_login.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, MIN(last_login) AS min_last_login FROM socialmedia.followers GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n image_url character varying(256) NOT NULL,\n description character varying(64) NOT NULL,\n author_id varchar,\n media_url char,\n score char,\n follower_id integer NOT NULL -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)\n\nCREATE TABLE socialmedia.groups (\n store_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n parking_available varchar,\n timezone text,\n location_lon character varying(128),\n accessibility character varying(64) NOT NULL\n)\n\nCREATE TABLE socialmedia.followers (\n person_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n birth_date timestamp NOT NULL,\n last_login timestamp without time zone,\n nationality varchar,\n language character varying(256),\n full_name char,\n salt character varying(64),\n password_hash character varying(64),\n group_id text NOT NULL -- reference to groups.store_id,\n FOREIGN KEY (group_id) REFERENCES groups(store_id)\n)", "conversations": [{"role": "user", "content": "List language, full_name, last_login from followers.", "sql": null}, {"role": "assistant", "content": "SELECT language, full_name, last_login FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Can you order these by birth_date ascending?", "sql": null}, {"role": "assistant", "content": "SELECT language, full_name, last_login FROM socialmedia.followers ORDER BY birth_date ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with language in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT language, full_name, last_login FROM socialmedia.followers ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Get image_url, author_id, title from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, author_id, title FROM education.grades;", "sql": null}, {"role": "user", "content": "Order the output by teacher_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, author_id, title FROM education.grades ORDER BY teacher_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of grades grouped by title.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM education.grades GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "What payee_id, reference_number, image_url, author_id do we have for assignments and their associated grades?", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.image_url, grades.author_id FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.post_id;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, grades.image_url, grades.author_id FROM education.assignments JOIN education.grades ON assignments.grade_id = grades.post_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Show me grade_id, rating, published_at for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, rating, published_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, rating, published_at FROM education.teachers ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "How many teachers are there per grade_id?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, COUNT(*) AS count FROM education.teachers GROUP BY grade_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reply_to_id, author_id, updated_at for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, author_id, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show me teachers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, author_id, updated_at FROM education.teachers WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Tally up teachers by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM education.teachers GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where teacher_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE teacher_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by likes descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE teacher_id LIKE 'A%' ORDER BY likes DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Get all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE user_id LIKE 'A%' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers where author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get count of rating by author_id from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(rating) AS count_rating FROM education.teachers GROUP BY author_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reply_to_id, rating, updated_at for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, rating, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve published_at, updated_at, edited_at, title showing the relationship between teachers and grades.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, rating, updated_at, grades.edited_at, grades.title FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.post_id;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, rating, updated_at, grades.edited_at, grades.title FROM education.teachers JOIN education.grades ON teachers.grade_id = grades.post_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show the results sorted by reply_to_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY reply_to_id DESC;", "sql": null}, {"role": "user", "content": "Sort the results by published_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY published_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n post_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n image_url character varying(64) NOT NULL,\n author_id character varying(128) NOT NULL,\n likes character varying(256) NOT NULL,\n title character varying(64),\n teacher_id text -- reference to teachers.post_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(post_id)\n)\n\nCREATE TABLE education.teachers (\n post_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at date,\n rating character varying(128),\n reply_to_id char -- identifier for reply_to,\n author_id character varying(256),\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)\n\nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n user_id char -- identifier for user,\n verification_status text NOT NULL,\n reference_number character varying(256),\n payee_id character varying(256) NOT NULL,\n grade_id text NOT NULL -- reference to grades.post_id,\n FOREIGN KEY (grade_id) REFERENCES grades(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "What are the last_login, venue_id, salt of each client?", "sql": null}, {"role": "assistant", "content": "SELECT last_login, venue_id, salt FROM music.clients;", "sql": null}, {"role": "user", "content": "List salt, last_login, last_inspected, created_at for each client along with their venue information.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, venue_id, salt, venues.last_inspected, venues.created_at FROM music.clients JOIN music.venues ON clients.venue_id = venues.store_id;", "sql": null}, {"role": "user", "content": "Group clients by last_login and show the max of email.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, MAX(email) AS max_email FROM music.clients GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Show me reference_number, balance, created_at for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, balance, created_at FROM music.payments;", "sql": null}, {"role": "user", "content": "Show the results sorted by invoice_number descending.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, balance, created_at FROM music.payments ORDER BY invoice_number DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, balance, created_at FROM music.payments ORDER BY invoice_number DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.venues;", "sql": null}, {"role": "user", "content": "List venues that have last_inspected > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.venues WHERE last_inspected > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.venues WHERE last_inspected > '2023-01-01' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve payment_id, created_at, coordinates for every venue.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, created_at, coordinates FROM music.venues;", "sql": null}, {"role": "user", "content": "Retrieve venues where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, created_at, coordinates FROM music.venues WHERE last_inspected <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group venues by coordinates and show the average of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, AVERAGE(created_at) AS average_created_at FROM music.venues GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Get created_at, display_name, email from all clients.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, display_name, email FROM music.clients;", "sql": null}, {"role": "user", "content": "Retrieve venue_id, created_at, created_at, longitude showing the relationship between clients and venues.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, display_name, email, venues.created_at, venues.longitude FROM music.clients JOIN music.venues ON clients.venue_id = venues.store_id;", "sql": null}, {"role": "user", "content": "Get the distribution of clients across different venue_id values.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, COUNT(*) AS count FROM music.clients GROUP BY venue_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Get venue_id, salt, created_at from all clients.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, salt, created_at FROM music.clients;", "sql": null}, {"role": "user", "content": "Show the results sorted by venue_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, salt, created_at FROM music.clients ORDER BY venue_id ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT venue_id, salt, created_at FROM music.clients ORDER BY venue_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve reference_number, user_id, created_at for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, user_id, created_at FROM music.payments;", "sql": null}, {"role": "user", "content": "List created_at, processed_at, description, last_inspected for each payment along with their venue information.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, user_id, created_at, venues.description, venues.last_inspected FROM music.payments JOIN music.venues ON payments.venue_id = venues.store_id;", "sql": null}, {"role": "user", "content": "Count the number of payments in each verification_status category.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, COUNT(*) AS count FROM music.payments GROUP BY verification_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, venue_id, reference_number for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, venue_id, reference_number FROM music.payments;", "sql": null}, {"role": "user", "content": "Retrieve payments where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, venue_id, reference_number FROM music.payments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Group payments by user_id and show the min of processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(processed_at) AS min_processed_at FROM music.payments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Show me verification_status, processed_at, venue_id for all payments.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, processed_at, venue_id FROM music.payments;", "sql": null}, {"role": "user", "content": "What processed_at, created_at, last_inspected, longitude do we have for payments and their associated venues?", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, processed_at, venue_id, venues.last_inspected, venues.longitude FROM music.payments JOIN music.venues ON payments.venue_id = venues.store_id;", "sql": null}, {"role": "user", "content": "Get min of user_id by user_id from payments.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(user_id) AS min_user_id FROM music.payments GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE music.clients (\n person_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n email character varying(64),\n last_login timestamp without time zone,\n age character varying(256),\n salt character varying(256) NOT NULL,\n display_name varchar,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)\n\nCREATE TABLE music.venues (\n store_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_inspected timestamp,\n description character varying(64) NOT NULL,\n coordinates character varying(128),\n longitude varchar NOT NULL,\n payment_id integer NOT NULL -- reference to payments.payment_id,\n FOREIGN KEY (payment_id) REFERENCES payments(payment_id)\n)\n\nCREATE TABLE music.payments (\n payment_id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n created_at date,\n balance numeric(38,14),\n reference_number character varying(64),\n user_id character varying(256) NOT NULL,\n verification_status char NOT NULL,\n invoice_number text,\n venue_id text NOT NULL -- reference to venues.store_id,\n FOREIGN KEY (venue_id) REFERENCES venues(store_id)\n)", "conversations": [{"role": "user", "content": "Display all clients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM music.clients;", "sql": null}, {"role": "user", "content": "Show me age, venue_id, longitude, last_inspected from clients and their related venues.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.longitude, venues.last_inspected FROM music.clients JOIN music.venues ON clients.venue_id = venues.store_id;", "sql": null}, {"role": "user", "content": "Sort the results by salt descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, venues.longitude, venues.last_inspected FROM music.clients JOIN music.venues ON clients.venue_id = venues.store_id ORDER BY salt DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many orders are there per processed_at?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM restaurant.orders GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get created_at, description, order_id from all stores.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, description, order_id FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "Find stores created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, description, order_id FROM restaurant.stores WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me the count of stores grouped by geo_point.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM restaurant.stores GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "Show me stores that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of stores across different address_line2 values.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, COUNT(*) AS count FROM restaurant.stores GROUP BY address_line2 ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "What created_at, location_lat, delivery_status, created_at do we have for stores and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.delivery_status, orders.created_at FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Get sum of capacity by description from stores.", "sql": null}, {"role": "assistant", "content": "SELECT description, SUM(capacity) AS sum_capacity FROM restaurant.stores GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.orders;", "sql": null}, {"role": "user", "content": "List orders that have created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.orders WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "What is the min store_id for each delivery_status in orders?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, MIN(store_id) AS min_store_id FROM restaurant.orders GROUP BY delivery_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the capacity, updated_at, geo_point of each store?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, updated_at, geo_point FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "Get geo_point, capacity, processed_at, store_id by joining stores with orders.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, updated_at, geo_point, orders.processed_at, orders.store_id FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Order the output by address_line2 descending.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, updated_at, geo_point, orders.processed_at, orders.store_id FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id ORDER BY address_line2 DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, location_lat, description of each store?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_lat, description FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "List location_lat, geo_point, delivery_status, store_id for each store along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_lat, description, orders.delivery_status, orders.store_id FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Show me the count of stores grouped by geo_point.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, COUNT(*) AS count FROM restaurant.stores GROUP BY geo_point ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "List order_id, geo_point, address_line2 from stores.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, geo_point, address_line2 FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "What geo_point, created_at, created_at, delivery_status do we have for stores and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, geo_point, address_line2, orders.created_at, orders.delivery_status FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, geo_point, address_line2, orders.created_at, orders.delivery_status FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "Retrieve stores where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.orders (\n invoice_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n delivery_status char,\n discount decimal NOT NULL,\n store_id text NOT NULL -- reference to stores.location_id,\n FOREIGN KEY (store_id) REFERENCES stores(location_id)\n)\n\nCREATE TABLE restaurant.stores (\n location_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n location_lat character varying(256),\n description varchar,\n address_line2 text NOT NULL,\n geo_point char,\n capacity character varying(64),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all stores.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.stores;", "sql": null}, {"role": "user", "content": "Show me location_lat, geo_point, delivery_status, store_id from stores and their related orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.delivery_status, orders.store_id FROM restaurant.stores JOIN restaurant.orders ON stores.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Show me sum of capacity grouped by updated_at for stores.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(capacity) AS sum_capacity FROM restaurant.stores GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY last_active ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List updated_at, likes, format from grades.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, likes, format FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with body LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, likes, format FROM education.grades WHERE body LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many grades are there per body?", "sql": null}, {"role": "assistant", "content": "SELECT body, COUNT(*) AS count FROM education.grades GROUP BY body ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by grade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY grade_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of students grouped by country.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM education.students GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List currency, transaction_id, processed_at from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT currency, transaction_id, processed_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where processed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, transaction_id, processed_at FROM education.teachers WHERE processed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT currency, transaction_id, processed_at FROM education.teachers WHERE processed_at > '2023-01-01' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List display_name, salt, country from students.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, salt, country FROM education.students;", "sql": null}, {"role": "user", "content": "Show the results sorted by grade_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, salt, country FROM education.students ORDER BY grade_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, salt, country FROM education.students ORDER BY grade_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, likes, student_id of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, likes, student_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Get student_id, body, grade_id, avatar by joining grades with students.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, likes, student_id, students.grade_id, students.avatar FROM education.grades JOIN education.students ON grades.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, likes, student_id, students.grade_id, students.avatar FROM education.grades JOIN education.students ON grades.student_id = students.employee_id ORDER BY media_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students with last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by display_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE last_active > '2023-01-01' ORDER BY display_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "List seller_id, transaction_id, processed_at from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, transaction_id, processed_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by card_type descending?", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, transaction_id, processed_at FROM education.teachers ORDER BY card_type DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with seller_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, transaction_id, processed_at FROM education.teachers ORDER BY seller_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where grade_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE grade_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE grade_id LIKE 'A%' ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at date,\n likes char,\n format character varying(256),\n media_url character varying(128) NOT NULL,\n body char,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n avatar char,\n gender text,\n salt character varying(128),\n country character varying(128) NOT NULL,\n display_name text,\n grade_id text -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.teachers (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n cancelled_at date,\n card_type character varying(256),\n user_id character varying(256),\n exchange_rate character varying(64) NOT NULL,\n amount bigint NOT NULL,\n seller_id varchar -- identifier for seller,\n currency character varying(128),\n grade_id text NOT NULL -- reference to grades.id,\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)", "conversations": [{"role": "user", "content": "Show me processed_at, currency, exchange_rate for all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, currency, exchange_rate FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, currency, exchange_rate FROM education.teachers WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many teachers are there per amount?", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM education.teachers GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "List backorder, order_item_id, rating from inventory.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, order_item_id, rating FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me published_at, rating, state, inventor_id from inventory and their related order_items.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, order_item_id, rating, order_items.state, order_items.inventor_id FROM e-commerce.inventory JOIN e-commerce.order_items ON inventory.order_item_id = order_items.id;", "sql": null}, {"role": "user", "content": "Calculate max of price for each thumbnail_url in inventory.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail_url, MAX(price) AS max_price FROM e-commerce.inventory GROUP BY thumbnail_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "What are the popularity_score, category, updated_at of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, category, updated_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where popularity_score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, category, updated_at FROM e-commerce.shipping WHERE popularity_score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group shipping by available and show the min of popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT available, MIN(popularity_score) AS min_popularity_score FROM e-commerce.shipping GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "What are the popularity_score, updated_at, category of each shipping?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, updated_at, category FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Get stock_level, popularity_score, email, state by joining shipping with order_items.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, updated_at, category, order_items.email, order_items.state FROM e-commerce.shipping JOIN e-commerce.order_items ON shipping.order_item_id = order_items.id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, updated_at, category, order_items.email, order_items.state FROM e-commerce.shipping JOIN e-commerce.order_items ON shipping.order_item_id = order_items.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "List state, shippin_id, updated_at from order_items.", "sql": null}, {"role": "assistant", "content": "SELECT state, shippin_id, updated_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Find order_items older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT state, shippin_id, updated_at FROM e-commerce.order_items WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with state in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT state, shippin_id, updated_at FROM e-commerce.order_items WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY state ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me thumbnail_url, published_at, shippin_id, state from inventory and their related order_items.", "sql": null}, {"role": "assistant", "content": "SELECT *, order_items.shippin_id, order_items.state FROM e-commerce.inventory JOIN e-commerce.order_items ON inventory.order_item_id = order_items.id;", "sql": null}, {"role": "user", "content": "Tally up inventory by rating.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM e-commerce.inventory GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve popularity_score, thumbnail_url, rating for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, thumbnail_url, rating FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, thumbnail_url, rating FROM e-commerce.inventory WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Can you order these by thumbnail_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, thumbnail_url, rating FROM e-commerce.inventory WHERE published_at > '2023-12-01' ORDER BY thumbnail_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Show me shippin_id, inventor_id, updated_at for all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, inventor_id, updated_at FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Can you order these by inventor_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, inventor_id, updated_at FROM e-commerce.order_items ORDER BY inventor_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT shippin_id, inventor_id, updated_at FROM e-commerce.order_items ORDER BY inventor_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Display all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items with inventor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE inventor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by email descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE inventor_id LIKE 'A%' ORDER BY email DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Get rating, order_item_id, popularity_score from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT rating, order_item_id, popularity_score FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by rating descending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, order_item_id, popularity_score FROM e-commerce.inventory ORDER BY rating DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, order_item_id, popularity_score FROM e-commerce.inventory ORDER BY popularity_score DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n updated_at date,\n stock_level text,\n popularity_score text NOT NULL,\n category varchar,\n available varchar,\n quantity varchar,\n order_item_id integer -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n sku text PRIMARY KEY -- unique identifier,\n published_at timestamp,\n rating character varying(128),\n featured_rank character varying(64),\n popularity_score varchar,\n backorder character varying(64),\n thumbnail_url character varying(64) NOT NULL,\n price integer,\n order_item_id integer NOT NULL -- reference to order_items.id,\n FOREIGN KEY (order_item_id) REFERENCES order_items(id)\n)\n\nCREATE TABLE e-commerce.order_items (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n state text NOT NULL,\n email varchar,\n nationality character varying(128),\n inventor_id text -- reference to inventory.sku,\n shippin_id text NOT NULL -- reference to shipping.sku,\n FOREIGN KEY (inventor_id) REFERENCES inventory(sku),\n FOREIGN KEY (shippin_id) REFERENCES shipping(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve available, order_item_id, published_at for every shipping.", "sql": null}, {"role": "assistant", "content": "SELECT available, order_item_id, published_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have quantity LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT available, order_item_id, published_at FROM e-commerce.shipping WHERE quantity LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT available, order_item_id, published_at FROM e-commerce.shipping WHERE quantity LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "List all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings;", "sql": null}, {"role": "user", "content": "Order the output by exchange_rate descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings ORDER BY exchange_rate DESC;", "sql": null}, {"role": "user", "content": "Sort the results by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings;", "sql": null}, {"role": "user", "content": "List bookings with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings WHERE completed_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "List accessibility, postal_code, state from addresses.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, postal_code, state FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with accessibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, postal_code, state FROM realestate.addresses WHERE accessibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by operating_hours descending.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, postal_code, state FROM realestate.addresses WHERE accessibility LIKE 'A%' ORDER BY operating_hours DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "What are the salt, booking_id, updated_at of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT salt, booking_id, updated_at FROM realestate.customers;", "sql": null}, {"role": "user", "content": "List customers that have salt LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT salt, booking_id, updated_at FROM realestate.customers WHERE salt LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many customers are there per status?", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM realestate.customers GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "List exchange_rate, payment_method, customer_id from bookings.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_method, customer_id FROM realestate.bookings;", "sql": null}, {"role": "user", "content": "Show me bookings with exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_method, customer_id FROM realestate.bookings WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of bookings grouped by payment_method.", "sql": null}, {"role": "assistant", "content": "SELECT payment_method, COUNT(*) AS count FROM realestate.bookings GROUP BY payment_method ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "Retrieve booking_id, created_at, salt for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, created_at, salt FROM realestate.customers;", "sql": null}, {"role": "user", "content": "Get salt, created_at, payment_method, exchange_rate by joining customers with bookings.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, created_at, salt, bookings.payment_method, bookings.exchange_rate FROM realestate.customers JOIN realestate.bookings ON customers.booking_id = bookings.id;", "sql": null}, {"role": "user", "content": "What is the average booking_id for each status in customers?", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(booking_id) AS average_booking_id FROM realestate.customers GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses;", "sql": null}, {"role": "user", "content": "Find addresses where operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.addresses WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of addresses grouped by operating_hours.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, COUNT(*) AS count FROM realestate.addresses GROUP BY operating_hours ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "Display all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings;", "sql": null}, {"role": "user", "content": "Find bookings where exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings WHERE exchange_rate LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "List all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM realestate.bookings;", "sql": null}, {"role": "user", "content": "List payment_method, customer_id, created_at, updated_at for each booking along with their customer information.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.created_at, customers.updated_at FROM realestate.bookings JOIN realestate.customers ON bookings.customer_id = customers.id;", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.created_at, customers.updated_at FROM realestate.bookings JOIN realestate.customers ON bookings.customer_id = customers.id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE realestate.addresses (\n address_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n description character varying(64),\n accessibility character varying(256) NOT NULL,\n operating_hours varchar,\n state char,\n postal_code text NOT NULL,\n booking_id integer -- reference to bookings.id,\n customer_id text NOT NULL -- reference to customers.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id),\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.bookings (\n id integer PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n payment_method char,\n exchange_rate character varying(256) NOT NULL,\n payment_status character varying(128),\n customer_id text -- reference to customers.id,\n FOREIGN KEY (customer_id) REFERENCES customers(id)\n)\n\nCREATE TABLE realestate.customers (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n address character varying(256),\n salt character varying(64),\n status char,\n booking_id integer NOT NULL -- reference to bookings.id,\n FOREIGN KEY (booking_id) REFERENCES bookings(id)\n)", "conversations": [{"role": "user", "content": "Get status, address, salt from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT status, address, salt FROM realestate.customers;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, address, salt FROM realestate.customers ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Count the number of customers in each address category.", "sql": null}, {"role": "assistant", "content": "SELECT address, COUNT(*) AS count FROM realestate.customers GROUP BY address ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades ORDER BY user_id DESC;", "sql": null}, {"role": "user", "content": "Count the number of trades in each completed_at category.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, COUNT(*) AS count FROM tradingplatform.trades GROUP BY completed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the discount, cancelled_at, user_id of each trade?", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, user_id FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Show me wallet_id, quantity, payer_id, payment_date from trades and their related wallets.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, user_id, wallets.payer_id, wallets.payment_date FROM tradingplatform.trades JOIN tradingplatform.wallets ON trades.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Arrange the results with completed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT discount, cancelled_at, user_id, wallets.payer_id, wallets.payment_date FROM tradingplatform.trades JOIN tradingplatform.wallets ON trades.wallet_id = wallets.payment_id ORDER BY completed_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me full_name, created_at, status for all users.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, created_at, status FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me status, state, payment_date, balance from users and their related wallets.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, created_at, status, wallets.payment_date, wallets.balance FROM tradingplatform.users JOIN tradingplatform.wallets ON users.wallet_id = wallets.payment_id;", "sql": null}, {"role": "user", "content": "Sort the results by first_name ascending.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, created_at, status, wallets.payment_date, wallets.balance FROM tradingplatform.users JOIN tradingplatform.wallets ON users.wallet_id = wallets.payment_id ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve quantity, wallet_id, cancelled_at for every trade.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, wallet_id, cancelled_at FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Retrieve trades where cancelled_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, wallet_id, cancelled_at FROM tradingplatform.trades WHERE cancelled_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me count of wallet_id grouped by user_id for trades.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(wallet_id) AS count_wallet_id FROM tradingplatform.trades GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match wallet_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE wallet_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users WHERE wallet_id LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the full_name, status, first_name of each user?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, status, first_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Get users that match state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, status, first_name FROM tradingplatform.users WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, status, first_name FROM tradingplatform.users WHERE state LIKE 'A%' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "List joined_at, full_name, language from users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, full_name, language FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Sort the results by first_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, full_name, language FROM tradingplatform.users ORDER BY first_name DESC;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, full_name, language FROM tradingplatform.users ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Get language, created_at, joined_at from all users.", "sql": null}, {"role": "assistant", "content": "SELECT language, created_at, joined_at FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Arrange the results with status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT language, created_at, joined_at FROM tradingplatform.users ORDER BY status DESC;", "sql": null}, {"role": "user", "content": "Can you order these by wallet_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT language, created_at, joined_at FROM tradingplatform.users ORDER BY wallet_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me full_name, language, first_name for all users.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, language, first_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, language, first_name FROM tradingplatform.users WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by first_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT full_name, language, first_name FROM tradingplatform.users WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at timestamp,\n created_at date,\n status varchar,\n first_name char NOT NULL,\n language char,\n full_name text NOT NULL,\n state character varying(64),\n wallet_id text NOT NULL -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n balance smallint,\n reconciliation_status character varying(64) NOT NULL,\n payer_id text,\n credit character varying(256) NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n completed_at date,\n user_id character varying(256) NOT NULL -- identifier for user,\n discount smallint NOT NULL,\n quantity character varying(128) NOT NULL,\n wallet_id text -- reference to wallets.payment_id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "List trades that have user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by discount descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE user_id LIKE 'A%' ORDER BY discount DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Arrange the results with timezone in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY timezone ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_login BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me the count of customers grouped by timezone.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, COUNT(*) AS count FROM finance.customers GROUP BY timezone ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Show me last_active, timezone, account_id for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, timezone, account_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, timezone, account_id FROM finance.customers WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different account_id values.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.customers GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve timezone, is_active, invoice_number, user_id showing the relationship between customers and accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.invoice_number, accounts.user_id FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.transaction_id;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.invoice_number, accounts.user_id FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.transaction_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "What are the timezone, account_id, last_active of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_id, last_active FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get last_login, account_id, invoice_number, created_at by joining customers with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_id, last_active, accounts.invoice_number, accounts.created_at FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.transaction_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, account_id, last_active, accounts.invoice_number, accounts.created_at FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.transaction_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the average bio for each timezone in customers?", "sql": null}, {"role": "assistant", "content": "SELECT timezone, AVERAGE(bio) AS average_bio FROM finance.customers GROUP BY timezone;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Retrieve bio, last_active, timezone for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT bio, last_active, timezone FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with account_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT bio, last_active, timezone FROM finance.customers ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "What is the average bio for each account_id in customers?", "sql": null}, {"role": "assistant", "content": "SELECT account_id, AVERAGE(bio) AS average_bio FROM finance.customers GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get timezone, joined_at, created_at, vendor_id by joining customers with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.created_at, accounts.vendor_id FROM finance.customers JOIN finance.accounts ON customers.account_id = accounts.transaction_id;", "sql": null}, {"role": "user", "content": "Group customers by last_active and show the average of last_active.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, AVERAGE(last_active) AS average_last_active FROM finance.customers GROUP BY last_active;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n last_active timestamp without time zone,\n bio char,\n timezone char NOT NULL,\n last_login timestamp without time zone,\n is_active boolean -- indicates if active is true,\n account_id integer NOT NULL -- reference to accounts.transaction_id,\n FOREIGN KEY (account_id) REFERENCES accounts(transaction_id)\n)\n\nCREATE TABLE finance.accounts (\n transaction_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id text -- identifier for user,\n vendor_id character varying(64) NOT NULL,\n credit character varying(64),\n invoice_number character varying(256),\n debit character varying(256),\n customer_id text\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where timezone LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE timezone LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of customers in each last_active category.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM finance.customers GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List employee_id, username, membership_level from enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, username, membership_level FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, username, membership_level FROM education.enrollments WHERE last_login <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up enrollments by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM education.enrollments GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many teachers are there per subtotal?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM education.teachers GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve joined_at, employee_id, last_login for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, employee_id, last_login FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, employee_id, last_login FROM education.enrollments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of enrollments in each password_hash category.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM education.enrollments GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve membership_level, joined_at, employee_id for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments with joined_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM education.enrollments WHERE joined_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Sort the results by country descending.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM education.enrollments WHERE joined_at > '2023-01-01' ORDER BY country DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers that have updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with subtotal in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE updated_at > '2023-01-01' ORDER BY subtotal DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve seller_id, payment_method, updated_at for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, payment_method, updated_at FROM education.teachers;", "sql": null}, {"role": "user", "content": "Arrange the results with subtotal in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, payment_method, updated_at FROM education.teachers ORDER BY subtotal ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, payment_method, updated_at FROM education.teachers ORDER BY subtotal ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the subtotal, updated_at, payment_method of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, updated_at, payment_method FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, updated_at, payment_method FROM education.teachers ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Get count of payment_method by subtotal from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(payment_method) AS count_payment_method FROM education.teachers GROUP BY subtotal;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Arrange the results with payment_method in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY payment_method DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY payment_method DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n seller_id character varying(256) -- identifier for seller,\n payment_method varchar NOT NULL,\n subtotal bigint\n)\n\nCREATE TABLE education.enrollments (\n employee_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n joined_at timestamp,\n username character varying(128) NOT NULL,\n last_login timestamp without time zone,\n password_hash varchar NOT NULL,\n membership_level varchar,\n country character varying(256) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers that have seller_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE seller_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by seller_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE seller_id LIKE 'A%' ORDER BY seller_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get attachment_url, assignment_id, course_id, language by joining enrollments with assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.course_id, assignments.language FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.employee_id;", "sql": null}, {"role": "user", "content": "Show me the count of enrollments grouped by body.", "sql": null}, {"role": "assistant", "content": "SELECT body, COUNT(*) AS count FROM education.enrollments GROUP BY body ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me attachment_url, published_at, updated_at, age from enrollments and their related assignments.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.updated_at, assignments.age FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.employee_id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, assignments.updated_at, assignments.age FROM education.enrollments JOIN education.assignments ON enrollments.assignment_id = assignments.employee_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, attachment_url, text for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, attachment_url, text FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, attachment_url, text FROM education.enrollments WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate sum of body for each attachment_url in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, SUM(body) AS sum_body FROM education.enrollments GROUP BY attachment_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "Display all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by body descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY body DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "Show me course_id, language, gender for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, language, gender FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments that have enrollment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, language, gender FROM education.assignments WHERE enrollment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by is_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, language, gender FROM education.assignments WHERE enrollment_id LIKE 'A%' ORDER BY is_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve age, last_login, created_at, card_type showing the relationship between assignments and courses.", "sql": null}, {"role": "assistant", "content": "SELECT *, courses.created_at, courses.card_type FROM education.assignments JOIN education.courses ON assignments.course_id = courses.id;", "sql": null}, {"role": "user", "content": "Show me min of age grouped by language for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT language, MIN(age) AS min_age FROM education.assignments GROUP BY language;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "List age, password_hash, language from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT age, password_hash, language FROM education.assignments;", "sql": null}, {"role": "user", "content": "Sort the results by gender ascending.", "sql": null}, {"role": "assistant", "content": "SELECT age, password_hash, language FROM education.assignments ORDER BY gender ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with is_active in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT age, password_hash, language FROM education.assignments ORDER BY is_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE language LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "List all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve enrollments where attachment_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE attachment_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE attachment_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.enrollments (\n post_id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n image_url character varying(128),\n text character varying(64) NOT NULL,\n body character varying(256),\n attachment_url text,\n assignment_id integer -- reference to assignments.employee_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(employee_id)\n)\n\nCREATE TABLE education.courses (\n id integer PRIMARY KEY -- unique identifier,\n created_at date,\n status character varying(256),\n card_type varchar,\n approval_status varchar,\n discount numeric(38,14) NOT NULL\n)\n\nCREATE TABLE education.assignments (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n is_active boolean,\n age character varying(128),\n language char,\n gender text,\n password_hash char,\n last_login timestamp NOT NULL,\n course_id integer -- reference to courses.id,\n enrollment_id text -- reference to enrollments.post_id,\n FOREIGN KEY (course_id) REFERENCES courses(id),\n FOREIGN KEY (enrollment_id) REFERENCES enrollments(post_id)\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE last_login > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by age ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE last_login > '2023-12-01' ORDER BY age ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n author_id varchar NOT NULL -- identifier for author,\n subject text,\n user_id character varying(64) NOT NULL -- identifier for user,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.events (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n notes character varying(256) NOT NULL,\n reconciliation_status text NOT NULL,\n customer_id character varying(128),\n user_id character varying(64),\n category varchar NOT NULL,\n vendor_id varchar -- identifier for vendor\n)\n\nCREATE TABLE socialmedia.followers (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n username text,\n first_name varchar,\n nationality character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n image_url varchar,\n title text\n)\n\nCREATE TABLE socialmedia.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_active date,\n email character varying(64) NOT NULL,\n first_name char NOT NULL,\n timezone character varying(64) NOT NULL,\n password_hash char,\n follower_id text -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users;", "sql": null}, {"role": "user", "content": "Sort the results by person_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY person_id ASC;", "sql": null}, {"role": "user", "content": "Order the output by created_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.users ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n author_id varchar NOT NULL -- identifier for author,\n subject text,\n user_id character varying(64) NOT NULL -- identifier for user,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.events (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n notes character varying(256) NOT NULL,\n reconciliation_status text NOT NULL,\n customer_id character varying(128),\n user_id character varying(64),\n category varchar NOT NULL,\n vendor_id varchar -- identifier for vendor\n)\n\nCREATE TABLE socialmedia.followers (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n username text,\n first_name varchar,\n nationality character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n image_url varchar,\n title text\n)\n\nCREATE TABLE socialmedia.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_active date,\n email character varying(64) NOT NULL,\n first_name char NOT NULL,\n timezone character varying(64) NOT NULL,\n password_hash char,\n follower_id text -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get all messages from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n author_id varchar NOT NULL -- identifier for author,\n subject text,\n user_id character varying(64) NOT NULL -- identifier for user,\n post_id text NOT NULL -- reference to posts.id,\n FOREIGN KEY (post_id) REFERENCES posts(id)\n)\n\nCREATE TABLE socialmedia.events (\n account_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n notes character varying(256) NOT NULL,\n reconciliation_status text NOT NULL,\n customer_id character varying(128),\n user_id character varying(64),\n category varchar NOT NULL,\n vendor_id varchar -- identifier for vendor\n)\n\nCREATE TABLE socialmedia.followers (\n person_id text PRIMARY KEY -- unique identifier,\n created_at date,\n username text,\n first_name varchar,\n nationality character varying(128) NOT NULL\n)\n\nCREATE TABLE socialmedia.posts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n image_url varchar,\n title text\n)\n\nCREATE TABLE socialmedia.users (\n person_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n last_active date,\n email character varying(64) NOT NULL,\n first_name char NOT NULL,\n timezone character varying(64) NOT NULL,\n password_hash char,\n follower_id text -- reference to followers.person_id,\n FOREIGN KEY (follower_id) REFERENCES followers(person_id)\n)", "conversations": [{"role": "user", "content": "Show me all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages that have edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Can you order these by author_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at > '2023-01-01' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Get all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.locations;", "sql": null}, {"role": "user", "content": "Find locations where address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.locations WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up locations by address_line2.", "sql": null}, {"role": "assistant", "content": "SELECT address_line2, COUNT(*) AS count FROM government.locations GROUP BY address_line2 ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by location_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments ORDER BY location_id DESC;", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments ORDER BY location_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments;", "sql": null}, {"role": "user", "content": "Find comments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "What are the published_at, updated_at, location_id of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, updated_at, location_id FROM government.comments;", "sql": null}, {"role": "user", "content": "Get comments that match description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, updated_at, location_id FROM government.comments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average description for each body in comments?", "sql": null}, {"role": "assistant", "content": "SELECT body, AVERAGE(description) AS average_description FROM government.comments GROUP BY body;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments;", "sql": null}, {"role": "user", "content": "List comments with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments WHERE published_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with keywords in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.comments ORDER BY keywords DESC;", "sql": null}, {"role": "user", "content": "Count the number of comments in each visibility category.", "sql": null}, {"role": "assistant", "content": "SELECT visibility, COUNT(*) AS count FROM government.comments GROUP BY visibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Retrieve all locations.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.locations;", "sql": null}, {"role": "user", "content": "List locations with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM government.locations WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get min of comment_id by updated_at from locations.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(comment_id) AS min_comment_id FROM government.locations GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "What are the updated_at, keywords, visibility of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, keywords, visibility FROM government.comments;", "sql": null}, {"role": "user", "content": "Can you order these by keywords ascending?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, keywords, visibility FROM government.comments ORDER BY keywords ASC;", "sql": null}, {"role": "user", "content": "Count the number of comments in each user_id category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM government.comments GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "Get keywords, body, description from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, body, description FROM government.comments;", "sql": null}, {"role": "user", "content": "Get thumbnail, location_id, created_at, comment_id by joining comments with locations.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, body, description, locations.created_at, locations.comment_id FROM government.comments JOIN government.locations ON comments.location_id = locations.venue_id;", "sql": null}, {"role": "user", "content": "Get max of user_id by description from comments.", "sql": null}, {"role": "assistant", "content": "SELECT description, MAX(user_id) AS max_user_id FROM government.comments GROUP BY description;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE government.comments (\n comment_id text PRIMARY KEY -- unique identifier,\n published_at date,\n updated_at timestamp,\n user_id character varying(256) -- identifier for user,\n body character varying(64),\n description varchar NOT NULL,\n thumbnail text,\n visibility varchar,\n keywords character varying(128),\n location_id text -- reference to locations.venue_id,\n FOREIGN KEY (location_id) REFERENCES locations(venue_id)\n)\n\nCREATE TABLE government.locations (\n venue_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n accessibility char,\n address_line2 character varying(256),\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE government.payments (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n payment_date date,\n payee_id varchar NOT NULL -- identifier for payee,\n reconciliation_status text NOT NULL,\n vendor_id char -- identifier for vendor,\n payer_id character varying(128) -- identifier for payer,\n category character varying(256),\n balance decimal\n)", "conversations": [{"role": "user", "content": "What are the created_at, comment_id, accessibility of each location?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, accessibility FROM government.locations;", "sql": null}, {"role": "user", "content": "Find locations where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, accessibility FROM government.locations WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Order the output by accessibility ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, accessibility FROM government.locations WHERE created_at > '2023-01-01' ORDER BY accessibility ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "List invoice_id, published_at, shares from content.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, published_at, shares FROM marketing.content;", "sql": null}, {"role": "user", "content": "Arrange the results with invoice_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, published_at, shares FROM marketing.content ORDER BY invoice_id DESC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_id, published_at, shares FROM marketing.content ORDER BY invoice_id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Retrieve published_at, views, description for every content.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, views, description FROM marketing.content;", "sql": null}, {"role": "user", "content": "Get all content created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, views, description FROM marketing.content WHERE published_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the sum description for each shares in content?", "sql": null}, {"role": "assistant", "content": "SELECT shares, SUM(description) AS sum_description FROM marketing.content GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "List published_at, shares, views from content.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, shares, views FROM marketing.content;", "sql": null}, {"role": "user", "content": "Sort the results by shares ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, shares, views FROM marketing.content ORDER BY shares ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, shares, views FROM marketing.content ORDER BY shares ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Display all invoices.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.invoices;", "sql": null}, {"role": "user", "content": "Get conten_id, reference_number, shares, description by joining invoices with content.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.shares, content.description FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id;", "sql": null}, {"role": "user", "content": "Sort the results by due_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.shares, content.description FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id ORDER BY due_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "List all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.content;", "sql": null}, {"role": "user", "content": "Can you order these by description ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.content ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Show me the count of content grouped by published_at.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM marketing.content GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Display all content.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.content;", "sql": null}, {"role": "user", "content": "Retrieve description, invoice_id, exchange_rate, balance showing the relationship between content and invoices.", "sql": null}, {"role": "assistant", "content": "SELECT *, invoices.exchange_rate, invoices.balance FROM marketing.content JOIN marketing.invoices ON content.invoice_id = invoices.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, invoices.exchange_rate, invoices.balance FROM marketing.content JOIN marketing.invoices ON content.invoice_id = invoices.invoice_id ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Display all invoices.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.invoices;", "sql": null}, {"role": "user", "content": "List conten_id, balance, description, invoice_id for each invoice along with their content information.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.description, content.invoice_id FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id;", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, content.description, content.invoice_id FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Display all invoices.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.invoices;", "sql": null}, {"role": "user", "content": "Get invoices that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.invoices WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of reference_number by reference_number from invoices.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, AVERAGE(reference_number) AS average_reference_number FROM marketing.invoices GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, status, balance for every invoice.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, balance FROM marketing.invoices;", "sql": null}, {"role": "user", "content": "List exchange_rate, conten_id, published_at, shares for each invoice along with their content information.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, balance, content.published_at, content.shares FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id;", "sql": null}, {"role": "user", "content": "Show me average of exchange_rate grouped by status for invoices.", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(exchange_rate) AS average_exchange_rate FROM marketing.invoices GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE marketing.content (\n id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n shares text,\n views text,\n description char,\n invoice_id integer NOT NULL -- reference to invoices.invoice_id,\n FOREIGN KEY (invoice_id) REFERENCES invoices(invoice_id)\n)\n\nCREATE TABLE marketing.invoices (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date date,\n reference_number text,\n status char,\n balance numeric(38,14),\n exchange_rate varchar,\n invoice_number text NOT NULL,\n conten_id integer -- reference to content.id,\n FOREIGN KEY (conten_id) REFERENCES content(id)\n)", "conversations": [{"role": "user", "content": "Show me all invoices.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM marketing.invoices;", "sql": null}, {"role": "user", "content": "What due_date, status, invoice_id, published_at do we have for invoices and their associated content?", "sql": null}, {"role": "assistant", "content": "SELECT *, content.invoice_id, content.published_at FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id;", "sql": null}, {"role": "user", "content": "Can you order these by exchange_rate descending?", "sql": null}, {"role": "assistant", "content": "SELECT *, content.invoice_id, content.published_at FROM marketing.invoices JOIN marketing.content ON invoices.conten_id = content.id ORDER BY exchange_rate DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions;", "sql": null}, {"role": "user", "content": "Show me transactions that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.transactions WHERE processed_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Group customers by created_at and show the max of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MAX(created_at) AS max_created_at FROM finance.customers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "What are the description, processed_at, status of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT description, processed_at, status FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, processed_at, status FROM finance.loans WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of amount for each approval_status in loans.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, AVERAGE(amount) AS average_amount FROM finance.loans GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "List processed_at, transaction_id, approval_status from loans.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, transaction_id, approval_status FROM finance.loans;", "sql": null}, {"role": "user", "content": "List loans with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, transaction_id, approval_status FROM finance.loans WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of loans in each payee_id category.", "sql": null}, {"role": "assistant", "content": "SELECT payee_id, COUNT(*) AS count FROM finance.loans GROUP BY payee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Display all loans.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans;", "sql": null}, {"role": "user", "content": "Retrieve loans where notes LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE notes LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by debit ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.loans WHERE notes LIKE 'A%' ORDER BY debit ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with full_name in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY full_name ASC;", "sql": null}, {"role": "user", "content": "Group customers by last_login and show the sum of zip_code.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, SUM(zip_code) AS sum_zip_code FROM finance.customers GROUP BY last_login;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Show me debit, payee_id, status for all loans.", "sql": null}, {"role": "assistant", "content": "SELECT debit, payee_id, status FROM finance.loans;", "sql": null}, {"role": "user", "content": "Can you order these by debit ascending?", "sql": null}, {"role": "assistant", "content": "SELECT debit, payee_id, status FROM finance.loans ORDER BY debit ASC;", "sql": null}, {"role": "user", "content": "How many loans are there per debit?", "sql": null}, {"role": "assistant", "content": "SELECT debit, COUNT(*) AS count FROM finance.loans GROUP BY debit ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "What are the notes, transaction_id, processed_at of each loan?", "sql": null}, {"role": "assistant", "content": "SELECT notes, transaction_id, processed_at FROM finance.loans;", "sql": null}, {"role": "user", "content": "Order the output by payee_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT notes, transaction_id, processed_at FROM finance.loans ORDER BY payee_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT notes, transaction_id, processed_at FROM finance.loans ORDER BY payee_id ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n subtotal smallint NOT NULL,\n exchange_rate varchar,\n card_type character varying(64) NOT NULL,\n customer_id integer -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.loans (\n id integer PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n status varchar,\n amount numeric,\n debit varchar NOT NULL,\n approval_status character varying(128) NOT NULL,\n notes text,\n description character varying(256) NOT NULL,\n payee_id character varying(64),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n joined_at timestamp without time zone,\n created_at timestamp without time zone,\n token text,\n zip_code varchar NOT NULL,\n phone character varying(256),\n last_login date,\n full_name character varying(128),\n transaction_id text -- reference to transactions.id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(id)\n)", "conversations": [{"role": "user", "content": "Get description, status, amount from all loans.", "sql": null}, {"role": "assistant", "content": "SELECT description, status, amount FROM finance.loans;", "sql": null}, {"role": "user", "content": "Show me loans with debit LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT description, status, amount FROM finance.loans WHERE debit LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up loans by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM finance.loans GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by description descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE postal_code LIKE 'A%' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "List timezone, is_active, account_id from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, is_active, account_id FROM library.users;", "sql": null}, {"role": "user", "content": "Get users that match is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, is_active, account_id FROM library.users WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Show me sum of zip_code grouped by account_id for users.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, SUM(zip_code) AS sum_zip_code FROM library.users GROUP BY account_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Display all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses;", "sql": null}, {"role": "user", "content": "Order the output by timezone ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses ORDER BY timezone ASC;", "sql": null}, {"role": "user", "content": "How many addresses are there per category?", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM library.addresses GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me geo_point, accessibility, description for all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, accessibility, description FROM library.addresses;", "sql": null}, {"role": "user", "content": "Find addresses created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, accessibility, description FROM library.addresses WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of addresses in each accessibility category.", "sql": null}, {"role": "assistant", "content": "SELECT accessibility, COUNT(*) AS count FROM library.addresses GROUP BY accessibility ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get is_active, last_login, zip_code from all users.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_login, zip_code FROM library.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_login, zip_code FROM library.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Can you order these by zip_code descending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_login, zip_code FROM library.users WHERE updated_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY zip_code DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses;", "sql": null}, {"role": "user", "content": "Retrieve addresses where geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE geo_point LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses;", "sql": null}, {"role": "user", "content": "Can you order these by category descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses ORDER BY category DESC;", "sql": null}, {"role": "user", "content": "Order the output by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all addresses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses;", "sql": null}, {"role": "user", "content": "Retrieve addresses where description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.addresses WHERE description LIKE 'A%' ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "List category, timezone, geo_point from addresses.", "sql": null}, {"role": "assistant", "content": "SELECT category, timezone, geo_point FROM library.addresses;", "sql": null}, {"role": "user", "content": "Show me addresses with geo_point LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT category, timezone, geo_point FROM library.addresses WHERE geo_point LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by timezone ascending?", "sql": null}, {"role": "assistant", "content": "SELECT category, timezone, geo_point FROM library.addresses WHERE geo_point LIKE 'A%' ORDER BY timezone ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE library.accounts (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reference_number char NOT NULL,\n verification_status text,\n vendor_id text NOT NULL,\n category character varying(256),\n amount decimal,\n exchange_rate text NOT NULL,\n user_id text -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)\n\nCREATE TABLE library.addresses (\n address_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n category char NOT NULL,\n geo_point char NOT NULL,\n accessibility varchar,\n description char,\n timezone character varying(128) NOT NULL,\n postal_code varchar,\n account_id integer -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE library.users (\n customer_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n last_active timestamp,\n last_login date,\n timezone character varying(64),\n zip_code character varying(128),\n is_active boolean,\n account_id integer NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.users;", "sql": null}, {"role": "user", "content": "Show me users that were created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.users WHERE last_login >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Sort the results by timezone descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM library.users WHERE last_login >= CURRENT_DATE - INTERVAL '30 days' ORDER BY timezone DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE category LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Group notifications by category and show the average of category.", "sql": null}, {"role": "assistant", "content": "SELECT category, AVERAGE(category) AS average_category FROM tradingplatform.notifications GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get notifications that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group notifications by category and show the min of invoice_number.", "sql": null}, {"role": "assistant", "content": "SELECT category, MIN(invoice_number) AS min_invoice_number FROM tradingplatform.notifications GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Retrieve invoice_number, category, created_at for every notification.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, created_at FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Show me payment_id, log_id, edited_at, image_url from notifications and their related logs.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, created_at, logs.edited_at, logs.image_url FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, category, created_at, logs.edited_at, logs.image_url FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Get all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Get log_id, due_date, message, description by joining notifications with logs.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.message, logs.description FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.message, logs.description FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve due_date, category, created_at, message showing the relationship between notifications and logs.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.created_at, logs.message FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id;", "sql": null}, {"role": "user", "content": "Calculate max of payment_id for each approval_status in notifications.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, MAX(payment_id) AS max_payment_id FROM tradingplatform.notifications GROUP BY approval_status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Retrieve exchange_rate, log_id, created_at for every notification.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, log_id, created_at FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve due_date, invoice_number, image_url, message showing the relationship between notifications and logs.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, log_id, created_at, logs.image_url, logs.message FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, log_id, created_at, logs.image_url, logs.message FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "What are the category, log_id, approval_status of each notification?", "sql": null}, {"role": "assistant", "content": "SELECT category, log_id, approval_status FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Find notifications where due_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT category, log_id, approval_status FROM tradingplatform.notifications WHERE due_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT category, log_id, approval_status FROM tradingplatform.notifications WHERE due_date > '2023-01-01' ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "List all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show me count of exchange_rate grouped by created_at for notifications.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(exchange_rate) AS count_exchange_rate FROM tradingplatform.notifications GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.notifications (\n payment_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n due_date timestamp without time zone,\n exchange_rate character varying(128),\n approval_status char,\n category character varying(256) NOT NULL,\n invoice_number character varying(256),\n log_id text NOT NULL -- reference to logs.post_id,\n FOREIGN KEY (log_id) REFERENCES logs(post_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n post_id text PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n created_at timestamp without time zone,\n message char,\n image_url character varying(64),\n description character varying(128),\n parent_id varchar -- identifier for parent\n)\n\nCREATE TABLE tradingplatform.trades (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n created_at timestamp,\n currency character varying(128),\n delivery_status character varying(128),\n status text\n)", "conversations": [{"role": "user", "content": "Display all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "List approval_status, category, created_at, parent_id for each notification along with their log information.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.created_at, logs.parent_id FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id;", "sql": null}, {"role": "user", "content": "Sort the results by log_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.created_at, logs.parent_id FROM tradingplatform.notifications JOIN tradingplatform.logs ON notifications.log_id = logs.post_id ORDER BY log_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List price, expires_at, api_key, password_hash for each product along with their user information.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.api_key, users.password_hash FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.api_key, users.password_hash FROM e-commerce.products JOIN e-commerce.users ON products.user_id = users.id ORDER BY expires_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of products in each price category.", "sql": null}, {"role": "assistant", "content": "SELECT price, COUNT(*) AS count FROM e-commerce.products GROUP BY price ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "What are the last_active, product_id, password_hash of each user?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, product_id, password_hash FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, product_id, password_hash FROM e-commerce.users WHERE last_active = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of users across different product_id values.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM e-commerce.users GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "What are the birth_date, api_key, last_active of each user?", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, api_key, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get all users from last week.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, api_key, last_active FROM e-commerce.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT birth_date, api_key, last_active FROM e-commerce.users WHERE last_active >= CURRENT_DATE - INTERVAL '7 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "List users that have product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with birth_date in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE product_id LIKE 'A%' ORDER BY birth_date ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "What are the product_id, password_hash, last_active of each user?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, password_hash, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, password_hash, last_active FROM e-commerce.users WHERE birth_date <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many users are there per api_key?", "sql": null}, {"role": "assistant", "content": "SELECT api_key, COUNT(*) AS count FROM e-commerce.users GROUP BY api_key ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY featured_rank DESC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY featured_rank DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "List product_id, password_hash, api_key from users.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, password_hash, api_key FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Can you order these by password_hash descending?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, password_hash, api_key FROM e-commerce.users ORDER BY password_hash DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, password_hash, api_key FROM e-commerce.users ORDER BY password_hash DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Arrange the results with backorder in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY backorder ASC;", "sql": null}, {"role": "user", "content": "Show me average of currency grouped by user_id for products.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, AVERAGE(currency) AS average_currency FROM e-commerce.products GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n sku varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n updated_at timestamp without time zone,\n stock_level character varying(256),\n price numeric(38,14) NOT NULL,\n backorder character varying(64),\n currency text NOT NULL,\n featured_rank char,\n tax_rate character varying(256),\n user_id text NOT NULL -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE e-commerce.users (\n id text PRIMARY KEY -- unique identifier,\n last_active date,\n api_key text,\n password_hash varchar,\n birth_date timestamp,\n product_id text NOT NULL -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Arrange the results with product_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY product_id ASC;", "sql": null}, {"role": "user", "content": "Get sum of birth_date by password_hash from users.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, SUM(birth_date) AS sum_birth_date FROM e-commerce.users GROUP BY password_hash;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Retrieve seller_id, amount, department_id for every prescription.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, amount, department_id FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, amount, department_id FROM healthcare.prescriptions WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, amount, department_id FROM healthcare.prescriptions WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many departments are there per patient_id?", "sql": null}, {"role": "assistant", "content": "SELECT patient_id, COUNT(*) AS count FROM healthcare.departments GROUP BY patient_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Group departments by parent_id and show the min of created_at.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, MIN(created_at) AS min_created_at FROM healthcare.departments GROUP BY parent_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of departments in each author_id category.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM healthcare.departments GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "What are the status, delivery_status, cancelled_at of each prescription?", "sql": null}, {"role": "assistant", "content": "SELECT status, delivery_status, cancelled_at FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get all prescriptions older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT status, delivery_status, cancelled_at FROM healthcare.prescriptions WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT status, delivery_status, cancelled_at FROM healthcare.prescriptions WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Show me currency, cancelled_at, tax for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT currency, cancelled_at, tax FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Can you order these by tax descending?", "sql": null}, {"role": "assistant", "content": "SELECT currency, cancelled_at, tax FROM healthcare.prescriptions ORDER BY tax DESC;", "sql": null}, {"role": "user", "content": "Show me max of status grouped by status for prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT status, MAX(status) AS max_status FROM healthcare.prescriptions GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve status, tax, created_at, updated_at showing the relationship between prescriptions and departments.", "sql": null}, {"role": "assistant", "content": "SELECT *, departments.created_at, departments.updated_at FROM healthcare.prescriptions JOIN healthcare.departments ON prescriptions.department_id = departments.message_id;", "sql": null}, {"role": "user", "content": "Calculate min of status for each department_id in prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, MIN(status) AS min_status FROM healthcare.prescriptions GROUP BY department_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Find departments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Get department_id, approval_status, status from all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, approval_status, status FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions where approval_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, approval_status, status FROM healthcare.prescriptions WHERE approval_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT department_id, approval_status, status FROM healthcare.prescriptions WHERE approval_status LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n message_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at timestamp,\n image_url text,\n author_id text -- identifier for author,\n views text,\n parent_id varchar -- identifier for parent,\n thumbnail char,\n patient_id text -- reference to patients.id,\n FOREIGN KEY (patient_id) REFERENCES patients(id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n created_at timestamp,\n status character varying(256) NOT NULL,\n delivery_status character varying(256),\n approval_status character varying(256),\n seller_id character varying(128) -- identifier for seller,\n tax smallint,\n currency text NOT NULL,\n amount numeric,\n department_id text NOT NULL -- reference to departments.message_id,\n FOREIGN KEY (department_id) REFERENCES departments(message_id)\n)\n\nCREATE TABLE healthcare.patients (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n website character varying(256) NOT NULL,\n profile_picture_url character varying(128),\n age character varying(64),\n country text\n)", "conversations": [{"role": "user", "content": "Display all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY image_url DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me count of cost grouped by created_at for products.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(cost) AS count_cost FROM e-commerce.products GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Find products between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of products across different created_at values.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.products GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me created_at, published_at, stock_level for all products.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, published_at, stock_level FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List video_url, order_id, total, completed_at for each product along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, published_at, stock_level, orders.total, orders.completed_at FROM e-commerce.products JOIN e-commerce.orders ON products.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "How many products are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM e-commerce.products GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Retrieve all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What views, order_id, tax, completed_at do we have for products and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.tax, orders.completed_at FROM e-commerce.products JOIN e-commerce.orders ON products.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.tax, orders.completed_at FROM e-commerce.products JOIN e-commerce.orders ON products.order_id = orders.payment_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "What are the price, published_at, views of each product?", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, views FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have price > 22.", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, views FROM e-commerce.products WHERE price > 22;", "sql": null}, {"role": "user", "content": "Show the results sorted by views descending.", "sql": null}, {"role": "assistant", "content": "SELECT price, published_at, views FROM e-commerce.products WHERE price > 22 ORDER BY views DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by video_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY video_url ASC;", "sql": null}, {"role": "user", "content": "Group products by order_id and show the min of stock_level.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, MIN(stock_level) AS min_stock_level FROM e-commerce.products GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me backorder, views, created_at for all products.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, views, created_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match stock_level LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, views, created_at FROM e-commerce.products WHERE stock_level LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 50 items.", "sql": null}, {"role": "assistant", "content": "SELECT backorder, views, created_at FROM e-commerce.products WHERE stock_level LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "List barcode, cost, price from products.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, cost, price FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Can you order these by published_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT barcode, cost, price FROM e-commerce.products ORDER BY published_at DESC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, cost, price FROM e-commerce.products ORDER BY published_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.products (\n barcode character varying(64) NOT NULL -- unique identifier,\n published_at timestamp without time zone,\n created_at timestamp,\n video_url text -- identifier for video_url,\n backorder character varying(256),\n views text,\n stock_level character varying(128) NOT NULL,\n cost integer,\n price numeric,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.orders (\n payment_id text PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n total numeric(38,14),\n tax decimal\n)\n\nCREATE TABLE e-commerce.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n updated_at date,\n nationality varchar,\n is_verified boolean NOT NULL,\n profile_picture_url character varying(64) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n reply_to_id character varying(256),\n thumbnail character varying(256),\n parent_id character varying(64) -- identifier for parent\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "What cost, barcode, total, created_at do we have for products and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.total, orders.created_at FROM e-commerce.products JOIN e-commerce.orders ON products.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Group products by barcode and show the max of cost.", "sql": null}, {"role": "assistant", "content": "SELECT barcode, MAX(cost) AS max_cost FROM e-commerce.products GROUP BY barcode;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Show me all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Find courses created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the count longitude for each type in courses?", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(longitude) AS count_longitude FROM education.courses GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Get longitude, teacher_id, type from all courses.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, teacher_id, type FROM education.courses;", "sql": null}, {"role": "user", "content": "What capacity, parking_available, created_at, parent_id do we have for courses and their associated teachers?", "sql": null}, {"role": "assistant", "content": "SELECT longitude, teacher_id, type, teachers.created_at, teachers.parent_id FROM education.courses JOIN education.teachers ON courses.teacher_id = teachers.content_id;", "sql": null}, {"role": "user", "content": "Show me count of created_at grouped by created_at for courses.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(created_at) AS count_created_at FROM education.courses GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Get all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get teachers that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of teachers in each course_id category.", "sql": null}, {"role": "assistant", "content": "SELECT course_id, COUNT(*) AS count FROM education.teachers GROUP BY course_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Show me teacher_id, longitude, type for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, type FROM education.courses;", "sql": null}, {"role": "user", "content": "List type, longitude, attachment_url, course_id for each course along with their teacher information.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, type, teachers.attachment_url, teachers.course_id FROM education.courses JOIN education.teachers ON courses.teacher_id = teachers.content_id;", "sql": null}, {"role": "user", "content": "Sort the results by type descending.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, type, teachers.attachment_url, teachers.course_id FROM education.courses JOIN education.teachers ON courses.teacher_id = teachers.content_id ORDER BY type DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Show me all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "List teachers with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "What are the teacher_id, postal_code, parking_available of each course?", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, postal_code, parking_available FROM education.courses;", "sql": null}, {"role": "user", "content": "Show me courses that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, postal_code, parking_available FROM education.courses WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "How many courses are there per capacity?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, COUNT(*) AS count FROM education.courses GROUP BY capacity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Get all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "List courses with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up courses by parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM education.courses GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "List all courses.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses;", "sql": null}, {"role": "user", "content": "Get courses that match postal_code LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE postal_code LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with longitude in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.courses WHERE postal_code LIKE 'A%' ORDER BY longitude DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Retrieve attachment_url, parent_id, course_id for every teacher.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, parent_id, course_id FROM education.teachers;", "sql": null}, {"role": "user", "content": "Find teachers where tags LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, parent_id, course_id FROM education.teachers WHERE tags LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up teachers by attachment_url.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, COUNT(*) AS count FROM education.teachers GROUP BY attachment_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.courses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n created_at timestamp without time zone,\n postal_code character varying(128),\n capacity varchar,\n type character varying(128),\n parking_available character varying(64) NOT NULL,\n longitude character varying(256),\n teacher_id integer -- reference to teachers.content_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(content_id)\n)\n\nCREATE TABLE education.teachers (\n content_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n attachment_url text,\n tags varchar,\n parent_id text -- identifier for parent,\n course_id text NOT NULL -- reference to courses.location_id,\n FOREIGN KEY (course_id) REFERENCES courses(location_id)\n)", "conversations": [{"role": "user", "content": "Show me parking_available, capacity, created_at for all courses.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, capacity, created_at FROM education.courses;", "sql": null}, {"role": "user", "content": "Retrieve courses where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, capacity, created_at FROM education.courses WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up courses by parking_available.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, COUNT(*) AS count FROM education.courses GROUP BY parking_available ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with shares in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY shares DESC;", "sql": null}, {"role": "user", "content": "What is the count subject for each shares in comments?", "sql": null}, {"role": "assistant", "content": "SELECT shares, COUNT(subject) AS count_subject FROM socialmedia.comments GROUP BY shares;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Show me updated_at, follower_id, shares for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, follower_id, shares FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me follower_id, updated_at, available, msrp from comments and their related followers.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, follower_id, shares, followers.available, followers.msrp FROM socialmedia.comments JOIN socialmedia.followers ON comments.follower_id = followers.barcode;", "sql": null}, {"role": "user", "content": "Calculate count of subject for each follower_id in comments.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(subject) AS count_subject FROM socialmedia.comments GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Display all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Sort the results by popularity_score descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY popularity_score DESC;", "sql": null}, {"role": "user", "content": "Only show the top 25 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers ORDER BY popularity_score DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate average of thumbnail for each follower_id in comments.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, AVERAGE(thumbnail) AS average_thumbnail FROM socialmedia.comments GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Show me followers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of followers in each comment_id category.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, COUNT(*) AS count FROM socialmedia.followers GROUP BY comment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Show me shares, updated_at, thumbnail for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT shares, updated_at, thumbnail FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments with subject LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT shares, updated_at, thumbnail FROM socialmedia.comments WHERE subject LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the max updated_at for each follower_id in comments?", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, MAX(updated_at) AS max_updated_at FROM socialmedia.comments GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get all followers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the count popularity_score for each available in followers?", "sql": null}, {"role": "assistant", "content": "SELECT available, COUNT(popularity_score) AS count_popularity_score FROM socialmedia.followers GROUP BY available;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "List created_at, comment_id, popularity_score from followers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, popularity_score FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List popularity_score, comment_id, follower_id, thumbnail for each follower along with their comment information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, popularity_score, comments.follower_id, comments.thumbnail FROM socialmedia.followers JOIN socialmedia.comments ON followers.comment_id = comments.content_id;", "sql": null}, {"role": "user", "content": "Order the output by msrp ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, comment_id, popularity_score, comments.follower_id, comments.thumbnail FROM socialmedia.followers JOIN socialmedia.comments ON followers.comment_id = comments.content_id ORDER BY msrp ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the max available for each msrp in followers?", "sql": null}, {"role": "assistant", "content": "SELECT msrp, MAX(available) AS max_available FROM socialmedia.followers GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.followers (\n barcode varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n popularity_score varchar,\n msrp char,\n available varchar,\n comment_id integer -- reference to comments.content_id,\n FOREIGN KEY (comment_id) REFERENCES comments(content_id)\n)\n\nCREATE TABLE socialmedia.posts (\n content_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp without time zone,\n published_at date,\n keywords text,\n shares character varying(64),\n media_url varchar NOT NULL,\n score text,\n thumbnail character varying(256) NOT NULL,\n content text\n)\n\nCREATE TABLE socialmedia.comments (\n content_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n subject char,\n thumbnail char,\n shares char,\n follower_id text NOT NULL -- reference to followers.barcode,\n FOREIGN KEY (follower_id) REFERENCES followers(barcode)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Retrieve followers where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at <= CURRENT_DATE - INTERVAL '6 months' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades ORDER BY created_at DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Get type, parking_available, created_at from all grades.", "sql": null}, {"role": "assistant", "content": "SELECT type, parking_available, created_at FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT type, parking_available, created_at FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT type, parking_available, created_at FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Tally up grades by student_id.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.grades GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Calculate min of type for each type in grades.", "sql": null}, {"role": "assistant", "content": "SELECT type, MIN(type) AS min_type FROM education.grades GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Show me location_lon, category, student_id for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, student_id FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where type LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lon, category, student_id FROM education.grades WHERE type LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up grades by coordinates.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, COUNT(*) AS count FROM education.grades GROUP BY coordinates ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Display all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "List category, parking_available, first_name, created_at for each grade along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.first_name, students.created_at FROM education.grades JOIN education.students ON grades.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Order the output by parking_available descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.first_name, students.created_at FROM education.grades JOIN education.students ON grades.student_id = students.employee_id ORDER BY parking_available DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Get all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades where category LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE category LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of grades in each category category.", "sql": null}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS count FROM education.grades GROUP BY category ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "Show me parking_available, category, coordinates for all grades.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, category, coordinates FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me parking_available, category, username, password_hash from grades and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, category, coordinates, students.username, students.password_hash FROM education.grades JOIN education.students ON grades.student_id = students.employee_id;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT parking_available, category, coordinates, students.username, students.password_hash FROM education.grades JOIN education.students ON grades.student_id = students.employee_id ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "List created_at, type, capacity from grades.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, type, capacity FROM education.grades;", "sql": null}, {"role": "user", "content": "Get all grades between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, type, capacity FROM education.grades WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Calculate max of capacity for each coordinates in grades.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, MAX(capacity) AS max_capacity FROM education.grades GROUP BY coordinates;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n name character varying(64),\n location_lon character varying(128),\n type character varying(128) NOT NULL,\n coordinates character varying(128) NOT NULL,\n parking_available character varying(128),\n capacity character varying(128),\n category character varying(256) NOT NULL,\n student_id text NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE education.students (\n employee_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n created_at timestamp,\n first_name char,\n username character varying(256),\n city varchar NOT NULL,\n password_hash varchar\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Show me grades with location_lon LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE location_lon LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me sum of name grouped by name for grades.", "sql": null}, {"role": "assistant", "content": "SELECT name, SUM(name) AS sum_name FROM education.grades GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve teacher_id, longitude, created_at for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, created_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Arrange the results with description in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, created_at FROM education.enrollments ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, longitude, created_at FROM education.enrollments ORDER BY description ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List coordinates, created_at, delivery_status, cancelled_at for each enrollment along with their teacher information.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.delivery_status, teachers.cancelled_at FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id;", "sql": null}, {"role": "user", "content": "Sort the results by teacher_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.delivery_status, teachers.cancelled_at FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id ORDER BY teacher_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, location_id, longitude for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_id, longitude FROM education.enrollments;", "sql": null}, {"role": "user", "content": "List enrollments with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_id, longitude FROM education.enrollments WHERE last_inspected >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, location_id, longitude FROM education.enrollments WHERE last_inspected >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get location_id, street, created_at from all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, street, created_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show me enrollments with teacher_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_id, street, created_at FROM education.enrollments WHERE teacher_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group enrollments by created_at and show the count of street.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(street) AS count_street FROM education.enrollments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Get all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve longitude, location_id, approval_status, cancelled_at showing the relationship between enrollments and teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.approval_status, teachers.cancelled_at FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id;", "sql": null}, {"role": "user", "content": "Only show the top 10 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.approval_status, teachers.cancelled_at FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve coordinates, geo_point, location_id for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, geo_point, location_id FROM education.enrollments;", "sql": null}, {"role": "user", "content": "What teacher_id, created_at, approval_status, subtotal do we have for enrollments and their associated teachers?", "sql": null}, {"role": "assistant", "content": "SELECT coordinates, geo_point, location_id, teachers.approval_status, teachers.subtotal FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id;", "sql": null}, {"role": "user", "content": "Show me sum of geo_point grouped by street for enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT street, SUM(geo_point) AS sum_geo_point FROM education.enrollments GROUP BY street;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve geo_point, street, created_at for every enrollment.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, street, created_at FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Show the results sorted by description ascending.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, street, created_at FROM education.enrollments ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Limit the results to 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, street, created_at FROM education.enrollments ORDER BY description ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Get all enrollments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the sum created_at for each teacher_id in enrollments?", "sql": null}, {"role": "assistant", "content": "SELECT teacher_id, SUM(created_at) AS sum_created_at FROM education.enrollments GROUP BY teacher_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.grades (\n invoice_id integer PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n completed_at date,\n seller_id character varying(64) -- identifier for seller,\n status character varying(256),\n card_type character varying(128),\n quantity char,\n currency character varying(128)\n)\n\nCREATE TABLE education.teachers (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n delivery_status char,\n approval_status char NOT NULL,\n subtotal numeric(38,14),\n payment_method text\n)\n\nCREATE TABLE education.enrollments (\n location_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at timestamp,\n longitude varchar,\n description character varying(256) NOT NULL,\n coordinates char,\n street varchar NOT NULL,\n geo_point character varying(64),\n teacher_id text -- reference to teachers.invoice_id,\n FOREIGN KEY (teacher_id) REFERENCES teachers(invoice_id)\n)", "conversations": [{"role": "user", "content": "Show me all enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.enrollments;", "sql": null}, {"role": "user", "content": "Retrieve description, last_inspected, payment_method, approval_status showing the relationship between enrollments and teachers.", "sql": null}, {"role": "assistant", "content": "SELECT *, teachers.payment_method, teachers.approval_status FROM education.enrollments JOIN education.teachers ON enrollments.teacher_id = teachers.invoice_id;", "sql": null}, {"role": "user", "content": "Calculate max of geo_point for each geo_point in enrollments.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, MAX(geo_point) AS max_geo_point FROM education.enrollments GROUP BY geo_point;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me last_active, website, email for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, email FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, email FROM tradingplatform.logs WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, website, email FROM tradingplatform.logs WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show me sum of created_at grouped by order_id for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, SUM(created_at) AS sum_created_at FROM tradingplatform.metadata GROUP BY order_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE last_active BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Tally up logs by order_id.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, COUNT(*) AS count FROM tradingplatform.logs GROUP BY order_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List last_active, address, card_type, created_at for each log along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.card_type, orders.created_at FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Arrange the results with order_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.card_type, orders.created_at FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id ORDER BY order_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Sort the results by email ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY email ASC;", "sql": null}, {"role": "user", "content": "Calculate average of order_id for each address in logs.", "sql": null}, {"role": "assistant", "content": "SELECT address, AVERAGE(order_id) AS average_order_id FROM tradingplatform.logs GROUP BY address;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Display all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List location_lat, created_at, created_at, card_type for each metadata along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.created_at, orders.card_type FROM tradingplatform.metadata JOIN tradingplatform.orders ON metadata.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by description.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get metadata that match order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of metadata grouped by updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve email, order_id, product_id, delivery_status showing the relationship between logs and orders.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.product_id, orders.delivery_status FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.product_id, orders.delivery_status FROM tradingplatform.logs JOIN tradingplatform.orders ON logs.order_id = orders.invoice_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp without time zone,\n description character varying(128),\n location_lat varchar NOT NULL,\n accessibility char,\n geo_point character varying(256),\n order_id text NOT NULL -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n email char,\n website character varying(128),\n address character varying(128),\n order_id text -- reference to orders.invoice_id,\n FOREIGN KEY (order_id) REFERENCES orders(invoice_id)\n)\n\nCREATE TABLE tradingplatform.orders (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n product_id character varying(256),\n card_type text,\n currency varchar,\n approval_status text,\n seller_id character varying(256) NOT NULL -- identifier for seller,\n delivery_status char NOT NULL\n)\n\nCREATE TABLE tradingplatform.trades (\n transaction_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n currency varchar,\n card_type character varying(256) NOT NULL,\n seller_id character varying(256)\n)", "conversations": [{"role": "user", "content": "List geo_point, description, accessibility from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, description, accessibility FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Arrange the results with geo_point in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, description, accessibility FROM tradingplatform.metadata ORDER BY geo_point DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT geo_point, description, accessibility FROM tradingplatform.metadata ORDER BY geo_point DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get all comments older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by format descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY format DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "What are the reply_to_id, body, published_at of each post?", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, body, published_at FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts where thumbnail LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, body, published_at FROM socialmedia.posts WHERE thumbnail LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by body descending.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, body, published_at FROM socialmedia.posts WHERE thumbnail LIKE 'A%' ORDER BY body DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me image_url, attachment_url, visibility, published_at from comments and their related posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.visibility, posts.published_at FROM socialmedia.comments JOIN socialmedia.posts ON comments.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Count the number of comments in each format category.", "sql": null}, {"role": "assistant", "content": "SELECT format, COUNT(*) AS count FROM socialmedia.comments GROUP BY format ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at > '2023-12-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "What are the image_url, post_id, visibility of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, visibility FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Order the output by image_url descending.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, visibility FROM socialmedia.comments ORDER BY image_url DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, visibility FROM socialmedia.comments ORDER BY image_url DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where visibility LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE visibility LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE visibility LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get post_id, visibility, comment_id, body by joining comments with posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.comment_id, posts.body FROM socialmedia.comments JOIN socialmedia.posts ON comments.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.comment_id, posts.body FROM socialmedia.comments JOIN socialmedia.posts ON comments.post_id = posts.message_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Get comments that match edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with attachment_url in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE edited_at > '2023-01-01' ORDER BY attachment_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "List all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with edited_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY edited_at DESC;", "sql": null}, {"role": "user", "content": "Tally up comments by post_id.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY post_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n message_id integer PRIMARY KEY -- unique identifier,\n published_at timestamp,\n visibility text,\n body char,\n thumbnail varchar,\n reply_to_id text -- identifier for reply_to,\n comment_id text -- reference to comments.comment_id,\n FOREIGN KEY (comment_id) REFERENCES comments(comment_id)\n)\n\nCREATE TABLE socialmedia.comments (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n format character varying(256) NOT NULL,\n visibility char,\n attachment_url character varying(64) NOT NULL,\n image_url char,\n post_id integer -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "What are the image_url, post_id, format of each comment?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, format FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments that have image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, format FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, post_id, format FROM socialmedia.comments WHERE image_url LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "What avatar, bio, approval_status, discount do we have for customers and their associated transactions?", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.approval_status, transactions.discount FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.approval_status, transactions.discount FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get avatar, token, country from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, token, country FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, token, country FROM finance.customers ORDER BY country ASC;", "sql": null}, {"role": "user", "content": "Count the number of customers in each payment_id category.", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM finance.customers GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me payment_id, token, currency, approval_status from customers and their related transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.currency, transactions.approval_status FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id;", "sql": null}, {"role": "user", "content": "How many customers are there per payment_id?", "sql": null}, {"role": "assistant", "content": "SELECT payment_id, COUNT(*) AS count FROM finance.customers GROUP BY payment_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Retrieve customers where display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by joined_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE display_name LIKE 'A%' ORDER BY joined_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me display_name, token, price, updated_at from customers and their related transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.price, transactions.updated_at FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id;", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different transaction_id values.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, COUNT(*) AS count FROM finance.customers GROUP BY transaction_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get display_name, avatar, payment_id from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, avatar, payment_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Arrange the results with country in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, avatar, payment_id FROM finance.customers ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Show me max of last_active grouped by joined_at for customers.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(last_active) AS max_last_active FROM finance.customers GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "List transaction_id, joined_at, bio from customers.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, joined_at, bio FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by transaction_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, joined_at, bio FROM finance.customers ORDER BY transaction_id DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT transaction_id, joined_at, bio FROM finance.customers ORDER BY transaction_id DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get country, payment_id, cancelled_at, discount by joining customers with transactions.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.cancelled_at, transactions.discount FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id;", "sql": null}, {"role": "user", "content": "Arrange the results with bio in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT *, transactions.cancelled_at, transactions.discount FROM finance.customers JOIN finance.transactions ON customers.transaction_id = transactions.transaction_id ORDER BY bio DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id text PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n token char,\n avatar character varying(128),\n display_name text NOT NULL,\n country character varying(64),\n bio character varying(128),\n transaction_id integer -- reference to transactions.transaction_id,\n payment_id text NOT NULL -- reference to payments.invoice_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id),\n FOREIGN KEY (payment_id) REFERENCES payments(invoice_id)\n)\n\nCREATE TABLE finance.transactions (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n updated_at timestamp,\n approval_status character varying(128) NOT NULL,\n currency character varying(128),\n price bigint NOT NULL,\n discount integer NOT NULL,\n total decimal\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at timestamp,\n subtotal numeric(38,14),\n card_type character varying(64),\n payment_status char,\n discount bigint\n)\n\nCREATE TABLE finance.accounts (\n payment_id character varying(64) NOT NULL -- unique identifier,\n due_date date,\n category character varying(64),\n notes text,\n user_id varchar -- identifier for user,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by bio ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY bio ASC;", "sql": null}, {"role": "user", "content": "What is the sum payment_id for each token in customers?", "sql": null}, {"role": "assistant", "content": "SELECT token, SUM(payment_id) AS sum_payment_id FROM finance.customers GROUP BY token;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Find events from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events WHERE last_inspected BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get the distribution of events across different last_inspected values.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, COUNT(*) AS count FROM socialmedia.events GROUP BY last_inspected ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve approval_status, invoice_number, processed_at for every follower.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, invoice_number, processed_at FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Order the output by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, invoice_number, processed_at FROM socialmedia.followers ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, invoice_number, processed_at FROM socialmedia.followers ORDER BY created_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "List all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List event_id, processed_at, last_inspected, follower_id for each follower along with their event information.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.last_inspected, events.follower_id FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.address_id;", "sql": null}, {"role": "user", "content": "Order the output by vendor_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, events.last_inspected, events.follower_id FROM socialmedia.followers JOIN socialmedia.events ON followers.event_id = events.address_id ORDER BY vendor_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Show me street, last_inspected, address_line2 for all events.", "sql": null}, {"role": "assistant", "content": "SELECT street, last_inspected, address_line2 FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Show me events with street LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT street, last_inspected, address_line2 FROM socialmedia.events WHERE street LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by address_line2 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT street, last_inspected, address_line2 FROM socialmedia.events WHERE street LIKE 'A%' ORDER BY address_line2 ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Show me all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "Get followers that match invoice_number LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE invoice_number LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE invoice_number LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Get all followers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers;", "sql": null}, {"role": "user", "content": "List followers with dates between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Show the results sorted by vendor_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.followers WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY vendor_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Sort the results by street descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events ORDER BY street DESC;", "sql": null}, {"role": "user", "content": "How many events are there per location_lat?", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM socialmedia.events GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "List last_inspected, street, location_lat from events.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, street, location_lat FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "Get events that match address_line2 LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, street, location_lat FROM socialmedia.events WHERE address_line2 LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, street, location_lat FROM socialmedia.events WHERE address_line2 LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "Get street, address_line2, location_lat from all events.", "sql": null}, {"role": "assistant", "content": "SELECT street, address_line2, location_lat FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What street, address_line2, event_id, created_at do we have for events and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT street, address_line2, location_lat, followers.event_id, followers.created_at FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.transaction_id;", "sql": null}, {"role": "user", "content": "Arrange the results with address_line2 in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT street, address_line2, location_lat, followers.event_id, followers.created_at FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.transaction_id ORDER BY address_line2 DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.events (\n address_id integer PRIMARY KEY -- unique identifier,\n last_inspected date,\n street varchar,\n location_lat text,\n address_line2 char,\n follower_id text -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n text character varying(256),\n image_url character varying(64),\n body char,\n visibility char,\n rating character varying(64) NOT NULL,\n score text\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n processed_at timestamp,\n approval_status varchar,\n vendor_id text,\n invoice_number character varying(64),\n event_id integer NOT NULL -- reference to events.address_id,\n FOREIGN KEY (event_id) REFERENCES events(address_id)\n)", "conversations": [{"role": "user", "content": "List all events.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.events;", "sql": null}, {"role": "user", "content": "What follower_id, address_line2, created_at, invoice_number do we have for events and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.invoice_number FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.transaction_id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.created_at, followers.invoice_number FROM socialmedia.events JOIN socialmedia.followers ON events.follower_id = followers.transaction_id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the discount, sku, cost of each product?", "sql": null}, {"role": "assistant", "content": "SELECT discount, sku, cost FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT discount, sku, cost FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT discount, sku, cost FROM e-commerce.products WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve brand, discount, video_url for every product.", "sql": null}, {"role": "assistant", "content": "SELECT brand, discount, video_url FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "List products that have brand LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT brand, discount, video_url FROM e-commerce.products WHERE brand LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by brand descending.", "sql": null}, {"role": "assistant", "content": "SELECT brand, discount, video_url FROM e-commerce.products WHERE brand LIKE 'A%' ORDER BY brand DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Show me products with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE published_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get all inventory modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me min of price grouped by views for inventory.", "sql": null}, {"role": "assistant", "content": "SELECT views, MIN(price) AS min_price FROM e-commerce.inventory GROUP BY views;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me brand, price, created_at for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT brand, price, created_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT brand, price, created_at FROM e-commerce.inventory ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Group inventory by expires_at and show the count of video_url.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(video_url) AS count_video_url FROM e-commerce.inventory GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Sort the results by categories descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items ORDER BY categories DESC;", "sql": null}, {"role": "user", "content": "Count the number of order_items in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.order_items GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all order_items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Show me order_items with message_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.order_items WHERE message_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of updated_at for each message_id in order_items.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(updated_at) AS count_updated_at FROM e-commerce.order_items GROUP BY message_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve media_url, user_id, title for every order_item.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, user_id, title FROM e-commerce.order_items;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, user_id, title FROM e-commerce.order_items ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "Show me the count of order_items grouped by message_id.", "sql": null}, {"role": "assistant", "content": "SELECT message_id, COUNT(*) AS count FROM e-commerce.order_items GROUP BY message_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "Get brand, item_id, created_at from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT brand, item_id, created_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show me inventory with video_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT brand, item_id, created_at FROM e-commerce.inventory WHERE video_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of inventory grouped by expires_at.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.inventory GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n item_id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp without time zone,\n created_at timestamp,\n brand character varying(256),\n price decimal,\n video_url character varying(64),\n views varchar,\n category character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n sku character varying(64) NOT NULL -- unique identifier,\n published_at date,\n subcategory character varying(64),\n brand character varying(128),\n discount smallint,\n video_url character varying(128) NOT NULL,\n manufacturer character varying(64),\n cost smallint,\n image_url varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n message_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp without time zone,\n created_at date,\n categories varchar NOT NULL,\n title character varying(256),\n user_id text NOT NULL -- identifier for user,\n visibility character varying(64) NOT NULL,\n media_url character varying(256)\n)", "conversations": [{"role": "user", "content": "List all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by category ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY category ASC;", "sql": null}, {"role": "user", "content": "Count the number of inventory in each brand category.", "sql": null}, {"role": "assistant", "content": "SELECT brand, COUNT(*) AS count FROM e-commerce.inventory GROUP BY brand ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Show me all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "List description, accessibility, display_name, updated_at for each facilitie along with their member information.", "sql": null}, {"role": "assistant", "content": "SELECT *, members.display_name, members.updated_at FROM travel.facilities JOIN travel.members ON facilities.member_id = members.id;", "sql": null}, {"role": "user", "content": "Sort the results by postal_code descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, members.display_name, members.updated_at FROM travel.facilities JOIN travel.members ON facilities.member_id = members.id ORDER BY postal_code DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Display all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Get zip_code, updated_at, display_name, state by joining facilities with members.", "sql": null}, {"role": "assistant", "content": "SELECT *, members.display_name, members.state FROM travel.facilities JOIN travel.members ON facilities.member_id = members.id;", "sql": null}, {"role": "user", "content": "How many facilities are there per member_id?", "sql": null}, {"role": "assistant", "content": "SELECT member_id, COUNT(*) AS count FROM travel.facilities GROUP BY member_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Display all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Retrieve user_id, payment_method, type, member_id showing the relationship between purchases and facilities.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.type, facilities.member_id FROM travel.purchases JOIN travel.facilities ON purchases.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "Calculate average of id for each card_type in purchases.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, AVERAGE(id) AS average_id FROM travel.purchases GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "List user_id, approval_status, id from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, id FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, id FROM travel.purchases WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, approval_status, id FROM travel.purchases WHERE payment_method LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "List all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Arrange the results with id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY id ASC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases ORDER BY id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Display all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Retrieve purchases where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me sum of payment_method grouped by created_at for purchases.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, SUM(payment_method) AS sum_payment_method FROM travel.purchases GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Get postal_code, accessibility, member_id from all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, accessibility, member_id FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Show me facilities that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, accessibility, member_id FROM travel.facilities WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Can you order these by postal_code descending?", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, accessibility, member_id FROM travel.facilities WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY postal_code DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Show me description, type, updated_at for all facilities.", "sql": null}, {"role": "assistant", "content": "SELECT description, type, updated_at FROM travel.facilities;", "sql": null}, {"role": "user", "content": "Show the results sorted by member_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, type, updated_at FROM travel.facilities ORDER BY member_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT description, type, updated_at FROM travel.facilities ORDER BY zip_code ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Show me all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "List approval_status, id, postal_code, description for each purchase along with their facilitie information.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.postal_code, facilities.description FROM travel.purchases JOIN travel.facilities ON purchases.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "What is the sum product_id for each facilitie_id in purchases?", "sql": null}, {"role": "assistant", "content": "SELECT facilitie_id, SUM(product_id) AS sum_product_id FROM travel.purchases GROUP BY facilitie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.purchases (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at timestamp without time zone,\n card_type char,\n product_id text,\n approval_status character varying(256) NOT NULL,\n total smallint,\n user_id varchar NOT NULL -- identifier for user,\n payment_method varchar NOT NULL,\n facilitie_id text NOT NULL -- reference to facilities.address_id,\n FOREIGN KEY (facilitie_id) REFERENCES facilities(address_id)\n)\n\nCREATE TABLE travel.facilities (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n description character varying(64),\n accessibility character varying(128),\n zip_code character varying(64) NOT NULL,\n type character varying(256),\n postal_code character varying(64) NOT NULL,\n member_id text NOT NULL -- reference to members.id,\n FOREIGN KEY (member_id) REFERENCES members(id)\n)\n\nCREATE TABLE travel.members (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n last_name varchar NOT NULL,\n first_name character varying(64),\n full_name character varying(128),\n state text,\n is_active boolean NOT NULL -- indicates if active is true,\n display_name char\n)", "conversations": [{"role": "user", "content": "Show me all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Show me approval_status, facilitie_id, zip_code, updated_at from purchases and their related facilities.", "sql": null}, {"role": "assistant", "content": "SELECT *, facilities.zip_code, facilities.updated_at FROM travel.purchases JOIN travel.facilities ON purchases.facilitie_id = facilities.address_id;", "sql": null}, {"role": "user", "content": "Get min of approval_status by created_at from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(approval_status) AS min_approval_status FROM travel.purchases GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "What updated_at, address_line1, updated_at, card_type do we have for venues and their associated purchases?", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.updated_at, purchases.card_type FROM travel.venues JOIN travel.purchases ON venues.purchase_id = purchases.payment_id;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, purchases.updated_at, purchases.card_type FROM travel.venues JOIN travel.purchases ON venues.purchase_id = purchases.payment_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Retrieve students where display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE display_name LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Find venues from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues WHERE updated_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many venues are there per purchase_id?", "sql": null}, {"role": "assistant", "content": "SELECT purchase_id, COUNT(*) AS count FROM travel.venues GROUP BY purchase_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "List students that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students WHERE last_active > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Get discount, approval_status, updated_at from all purchases.", "sql": null}, {"role": "assistant", "content": "SELECT discount, approval_status, updated_at FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Show me purchases with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT discount, approval_status, updated_at FROM travel.purchases WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT discount, approval_status, updated_at FROM travel.purchases WHERE updated_at > '2023-01-01' ORDER BY payment_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List all venues.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.venues ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Calculate max of updated_at for each location_lat in venues.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, MAX(updated_at) AS max_updated_at FROM travel.venues GROUP BY location_lat;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students;", "sql": null}, {"role": "user", "content": "Can you order these by is_verified ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM travel.students ORDER BY is_verified ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of students across different last_active values.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM travel.students GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "List student_id, payment_status, card_type from purchases.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, payment_status, card_type FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, payment_status, card_type FROM travel.purchases ORDER BY approval_status ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, payment_status, card_type FROM travel.purchases ORDER BY approval_status ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE travel.students (\n employee_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp without time zone,\n country varchar,\n username character varying(64),\n display_name text,\n is_verified boolean -- indicates if verified is true,\n last_name character varying(128),\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)\n\nCREATE TABLE travel.purchases (\n payment_id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at timestamp,\n card_type character varying(128),\n payment_status character varying(64),\n discount numeric(38,14),\n approval_status varchar,\n student_id integer NOT NULL -- reference to students.employee_id,\n FOREIGN KEY (student_id) REFERENCES students(employee_id)\n)\n\nCREATE TABLE travel.venues (\n address_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n state character varying(128),\n location_lat character varying(128),\n country char NOT NULL,\n purchase_id text -- reference to purchases.payment_id,\n FOREIGN KEY (purchase_id) REFERENCES purchases(payment_id)\n)", "conversations": [{"role": "user", "content": "What are the approval_status, discount, processed_at of each purchase?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, discount, processed_at FROM travel.purchases;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, discount, processed_at FROM travel.purchases ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "How many purchases are there per approval_status?", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, COUNT(*) AS count FROM travel.purchases GROUP BY approval_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Show me order_id, edited_at, updated_at for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, edited_at, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, edited_at, updated_at FROM e-commerce.reviews ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Calculate average of format for each media_url in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, AVERAGE(format) AS average_format FROM e-commerce.reviews GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Show me format, updated_at, post_id for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT format, updated_at, post_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT format, updated_at, post_id FROM e-commerce.reviews WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate sum of media_url for each post_id in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, SUM(media_url) AS sum_media_url FROM e-commerce.reviews GROUP BY post_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Show me post_id, updated_at, order_id for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, updated_at, order_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Find reviews created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, updated_at, order_id FROM e-commerce.reviews WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Order the output by edited_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, updated_at, order_id FROM e-commerce.reviews WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY edited_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "List order_id, media_url, updated_at from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, media_url, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "What media_url, order_id, product_id, currency do we have for reviews and their associated orders?", "sql": null}, {"role": "assistant", "content": "SELECT order_id, media_url, updated_at, orders.product_id, orders.currency FROM e-commerce.reviews JOIN e-commerce.orders ON reviews.order_id = orders.transaction_id;", "sql": null}, {"role": "user", "content": "Order the output by edited_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT order_id, media_url, updated_at, orders.product_id, orders.currency FROM e-commerce.reviews JOIN e-commerce.orders ON reviews.order_id = orders.transaction_id ORDER BY edited_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where format LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE format LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with post_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE format LIKE 'A%' ORDER BY post_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Show me all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show only 10 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "List post_id, order_id, updated_at from reviews.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, order_id, updated_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Get updated_at, order_id, cancelled_at, delivery_status by joining reviews with orders.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, order_id, updated_at, orders.cancelled_at, orders.delivery_status FROM e-commerce.reviews JOIN e-commerce.orders ON reviews.order_id = orders.transaction_id;", "sql": null}, {"role": "user", "content": "Group reviews by edited_at and show the sum of post_id.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, SUM(post_id) AS sum_post_id FROM e-commerce.reviews GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Sort the results by media_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY media_url ASC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews ORDER BY media_url ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Get media_url, format, post_id from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, format, post_id FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, format, post_id FROM e-commerce.reviews WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up reviews by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM e-commerce.reviews GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n post_id character varying(64) NOT NULL -- unique identifier,\n edited_at timestamp without time zone,\n updated_at timestamp,\n media_url char,\n format char,\n order_id text -- reference to orders.transaction_id,\n FOREIGN KEY (order_id) REFERENCES orders(transaction_id)\n)\n\nCREATE TABLE e-commerce.orders (\n transaction_id text PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n processed_at timestamp,\n delivery_status char,\n account_id char,\n currency text NOT NULL,\n product_id character varying(128) -- identifier for product,\n buyer_id varchar\n)\n\nCREATE TABLE e-commerce.order_items (\n id varchar PRIMARY KEY -- unique identifier,\n published_at timestamp,\n title character varying(64),\n backorder character varying(256) NOT NULL,\n stock_level varchar,\n featured_rank character varying(256) NOT NULL,\n reserved char NOT NULL,\n price integer\n)", "conversations": [{"role": "user", "content": "Retrieve all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Retrieve reviews where order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of format for each updated_at in reviews.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(format) AS average_format FROM e-commerce.reviews GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "What are the manufacturer, views, expires_at of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, views, expires_at FROM education.grades;", "sql": null}, {"role": "user", "content": "What teacher_id, updated_at, category, quantity do we have for grades and their associated teachers?", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, views, expires_at, teachers.category, teachers.quantity FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.sku;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, views, expires_at, teachers.category, teachers.quantity FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.sku LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "Show me display_name, updated_at, teacher_id for all students.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, updated_at, teacher_id FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match display_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, updated_at, teacher_id FROM education.students WHERE display_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me min of token grouped by updated_at for students.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(token) AS min_token FROM education.students GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "What are the expires_at, available, featured_rank of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, featured_rank FROM education.teachers;", "sql": null}, {"role": "user", "content": "List rating, quantity, updated_at, membership_level for each teacher along with their student information.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, featured_rank, students.updated_at, students.membership_level FROM education.teachers JOIN education.students ON teachers.student_id = students.user_id;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, available, featured_rank, students.updated_at, students.membership_level FROM education.teachers JOIN education.students ON teachers.student_id = students.user_id ORDER BY expires_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "Display all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by available descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY available DESC;", "sql": null}, {"role": "user", "content": "How many teachers are there per quantity?", "sql": null}, {"role": "assistant", "content": "SELECT quantity, COUNT(*) AS count FROM education.teachers GROUP BY quantity ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "Get all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students ORDER BY updated_at DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "What are the expires_at, price, manufacturer of each grade?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, manufacturer FROM education.grades;", "sql": null}, {"role": "user", "content": "What manufacturer, updated_at, grade_id, rating do we have for grades and their associated teachers?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, price, manufacturer, teachers.grade_id, teachers.rating FROM education.grades JOIN education.teachers ON grades.teacher_id = teachers.sku;", "sql": null}, {"role": "user", "content": "What is the min expires_at for each updated_at in grades?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(expires_at) AS min_expires_at FROM education.grades GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "List rating, grade_id, category from teachers.", "sql": null}, {"role": "assistant", "content": "SELECT rating, grade_id, category FROM education.teachers;", "sql": null}, {"role": "user", "content": "Get all teachers from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT rating, grade_id, category FROM education.teachers WHERE expires_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many teachers are there per expires_at?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM education.teachers GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Retrieve grades where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of grades in each views category.", "sql": null}, {"role": "assistant", "content": "SELECT views, COUNT(*) AS count FROM education.grades GROUP BY views ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "Get all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Show the results sorted by available ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY available ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of teachers across different expires_at values.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM education.teachers GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.teachers (\n sku integer PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n category character varying(256),\n quantity character varying(64),\n featured_rank character varying(64),\n available char,\n rating character varying(256),\n student_id text NOT NULL -- reference to students.user_id,\n grade_id integer -- reference to grades.id,\n FOREIGN KEY (student_id) REFERENCES students(user_id),\n FOREIGN KEY (grade_id) REFERENCES grades(id)\n)\n\nCREATE TABLE education.grades (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n expires_at timestamp without time zone,\n views char,\n manufacturer char,\n price smallint,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)\n\nCREATE TABLE education.students (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n joined_at date,\n membership_level text,\n display_name character varying(128),\n token char,\n teacher_id integer NOT NULL -- reference to teachers.sku,\n FOREIGN KEY (teacher_id) REFERENCES teachers(sku)\n)", "conversations": [{"role": "user", "content": "List all grades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades;", "sql": null}, {"role": "user", "content": "Find grades where price > 36.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE price > 36;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.grades WHERE price > 36 ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show me messages with user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group messages by rating and show the average of rating.", "sql": null}, {"role": "assistant", "content": "SELECT rating, AVERAGE(rating) AS average_rating FROM socialmedia.messages GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Tally up messages by media_url.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, COUNT(*) AS count FROM socialmedia.messages GROUP BY media_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Calculate min of content_id for each user_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, MIN(content_id) AS min_content_id FROM socialmedia.messages GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show the results sorted by rating descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY rating DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "How many messages are there per rating?", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(*) AS count FROM socialmedia.messages GROUP BY rating ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me published_at, rating, user_id for all messages.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, rating, user_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Show the results sorted by published_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, rating, user_id FROM socialmedia.messages ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Calculate average of description for each follower_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, AVERAGE(description) AS average_description FROM socialmedia.messages GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "List published_at, description, user_id from messages.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, user_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Sort the results by rating ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, user_id FROM socialmedia.messages ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with content_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, description, user_id FROM socialmedia.messages ORDER BY content_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get description, user_id, published_at from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT description, user_id, published_at FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT description, user_id, published_at FROM socialmedia.messages WHERE published_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate min of user_id for each follower_id in messages.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, MIN(user_id) AS min_user_id FROM socialmedia.messages GROUP BY follower_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Get rating, user_id, description from all messages.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, description FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve description, user_id, description, payer_id showing the relationship between messages and followers.", "sql": null}, {"role": "assistant", "content": "SELECT rating, user_id, description, followers.description, followers.payer_id FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.invoice_id;", "sql": null}, {"role": "user", "content": "Group messages by media_url and show the average of published_at.", "sql": null}, {"role": "assistant", "content": "SELECT media_url, AVERAGE(published_at) AS average_published_at FROM socialmedia.messages GROUP BY media_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n content_id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n media_url character varying(128),\n user_id char,\n rating char,\n description character varying(128),\n follower_id integer NOT NULL -- reference to followers.invoice_id,\n FOREIGN KEY (follower_id) REFERENCES followers(invoice_id)\n)\n\nCREATE TABLE socialmedia.followers (\n invoice_id integer PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n processed_at date,\n payer_id character varying(256) -- identifier for payer,\n description char NOT NULL,\n user_id text -- identifier for user,\n category character varying(128) NOT NULL,\n balance smallint NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve description, user_id, content_id for every message.", "sql": null}, {"role": "assistant", "content": "SELECT description, user_id, content_id FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "What description, content_id, user_id, description do we have for messages and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT description, user_id, content_id, followers.user_id, followers.description FROM socialmedia.messages JOIN socialmedia.followers ON messages.follower_id = followers.invoice_id;", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different follower_id values.", "sql": null}, {"role": "assistant", "content": "SELECT follower_id, COUNT(*) AS count FROM socialmedia.messages GROUP BY follower_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List expires_at, views, asset_id from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, asset_id FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by asset_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, asset_id FROM tradingplatform.metadata ORDER BY asset_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, views, asset_id FROM tradingplatform.metadata ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List manufacturer, metadat_id, published_at from assets.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, metadat_id, published_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets with published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, metadat_id, published_at FROM tradingplatform.assets WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of assets in each metadat_id category.", "sql": null}, {"role": "assistant", "content": "SELECT metadat_id, COUNT(*) AS count FROM tradingplatform.assets GROUP BY metadat_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Calculate sum of image_url for each category in assets.", "sql": null}, {"role": "assistant", "content": "SELECT category, SUM(image_url) AS sum_image_url FROM tradingplatform.assets GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve published_at, category, rating, backorder showing the relationship between assets and metadata.", "sql": null}, {"role": "assistant", "content": "SELECT *, metadata.rating, metadata.backorder FROM tradingplatform.assets JOIN tradingplatform.metadata ON assets.metadat_id = metadata.sku;", "sql": null}, {"role": "user", "content": "How many assets are there per expires_at?", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM tradingplatform.assets GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve tax_rate, created_at, rating for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, created_at, rating FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, created_at, rating FROM tradingplatform.metadata WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the average tax_rate for each tax_rate in metadata?", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, AVERAGE(tax_rate) AS average_tax_rate FROM tradingplatform.metadata GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Display all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Retrieve assets where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE published_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Count the number of assets in each expires_at category.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM tradingplatform.assets GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Display all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Show me assets that were modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets WHERE expires_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many assets are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM tradingplatform.assets GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "What are the tax_rate, views, backorder of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, views, backorder FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List rating, video_url, expires_at, metadat_id for each metadata along with their asset information.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, views, backorder, assets.expires_at, assets.metadat_id FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.item_id;", "sql": null}, {"role": "user", "content": "Show me min of created_at grouped by tax_rate for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT tax_rate, MIN(created_at) AS min_created_at FROM tradingplatform.metadata GROUP BY tax_rate;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List tax_rate, video_url, expires_at, manufacturer for each metadata along with their asset information.", "sql": null}, {"role": "assistant", "content": "SELECT *, assets.expires_at, assets.manufacturer FROM tradingplatform.metadata JOIN tradingplatform.assets ON metadata.asset_id = assets.item_id;", "sql": null}, {"role": "user", "content": "Show me count of views grouped by rating for metadata.", "sql": null}, {"role": "assistant", "content": "SELECT rating, COUNT(views) AS count_views FROM tradingplatform.metadata GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.metadata (\n sku text PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n created_at date,\n rating varchar NOT NULL,\n video_url character varying(64) -- identifier for video_url,\n backorder char,\n views text,\n tax_rate character varying(128),\n asset_id text -- reference to assets.item_id,\n FOREIGN KEY (asset_id) REFERENCES assets(item_id)\n)\n\nCREATE TABLE tradingplatform.assets (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n published_at timestamp,\n category char,\n manufacturer character varying(64),\n image_url char NOT NULL,\n metadat_id text NOT NULL -- reference to metadata.sku,\n FOREIGN KEY (metadat_id) REFERENCES metadata(sku)\n)", "conversations": [{"role": "user", "content": "Retrieve image_url, manufacturer, published_at for every asset.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, manufacturer, published_at FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Order the output by manufacturer ascending.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, manufacturer, published_at FROM tradingplatform.assets ORDER BY manufacturer ASC;", "sql": null}, {"role": "user", "content": "Calculate average of manufacturer for each category in assets.", "sql": null}, {"role": "assistant", "content": "SELECT category, AVERAGE(manufacturer) AS average_manufacturer FROM tradingplatform.assets GROUP BY category;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Show me wallets with debit LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE debit LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me average of debit grouped by notification_id for wallets.", "sql": null}, {"role": "assistant", "content": "SELECT notification_id, AVERAGE(debit) AS average_debit FROM tradingplatform.wallets GROUP BY notification_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all notifications.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications;", "sql": null}, {"role": "user", "content": "Retrieve notifications where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.notifications WHERE published_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Can you order these by bio ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY bio ASC;", "sql": null}, {"role": "user", "content": "Can you order these by language descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get is_active, last_active, bio from all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_active, bio FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Can you order these by language descending?", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_active, bio FROM tradingplatform.metadata ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with notification_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT is_active, last_active, bio FROM tradingplatform.metadata ORDER BY notification_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by display_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY display_name DESC;", "sql": null}, {"role": "user", "content": "Tally up metadata by display_name.", "sql": null}, {"role": "assistant", "content": "SELECT display_name, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY display_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "List bio, last_active, updated_at from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT bio, last_active, updated_at FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show me metadata with is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT bio, last_active, updated_at FROM tradingplatform.metadata WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Arrange the results with language in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT bio, last_active, updated_at FROM tradingplatform.metadata WHERE is_active = TRUE ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.wallets (\n account_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n verification_status varchar,\n vendor_id char NOT NULL -- identifier for vendor,\n status character varying(128),\n debit character varying(128) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.metadata (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n last_active timestamp,\n is_active bit,\n display_name varchar,\n bio varchar NOT NULL,\n first_name character varying(64),\n language character varying(64) NOT NULL,\n notification_id text -- reference to notifications.id,\n FOREIGN KEY (notification_id) REFERENCES notifications(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n published_at date,\n attachment_url text NOT NULL,\n keywords character varying(256),\n reply_to_id char -- identifier for reply_to,\n views varchar NOT NULL,\n metadat_id integer NOT NULL -- reference to metadata.person_id,\n wallet_id integer -- reference to wallets.account_id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(person_id),\n FOREIGN KEY (wallet_id) REFERENCES wallets(account_id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with verification_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets ORDER BY verification_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Retrieve all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get barcode, rating, display_name, membership_level by joining groups with users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.display_name, users.membership_level FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.display_name, users.membership_level FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Get rating, reserved, updated_at from all groups.", "sql": null}, {"role": "assistant", "content": "SELECT rating, reserved, updated_at FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Get available, video_url, membership_level, last_name by joining groups with users.", "sql": null}, {"role": "assistant", "content": "SELECT rating, reserved, updated_at, users.membership_level, users.last_name FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Order the output by rating descending.", "sql": null}, {"role": "assistant", "content": "SELECT rating, reserved, updated_at, users.membership_level, users.last_name FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id ORDER BY rating DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Retrieve reserved, msrp, barcode for every group.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, barcode FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Retrieve available, reserved, account_status, last_active showing the relationship between groups and users.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, barcode, users.account_status, users.last_active FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, barcode, users.account_status, users.last_active FROM socialmedia.groups JOIN socialmedia.users ON groups.user_id = users.user_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Retrieve id, title, keywords for every message.", "sql": null}, {"role": "assistant", "content": "SELECT id, title, keywords FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "List messages with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT id, title, keywords FROM socialmedia.messages WHERE edited_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT id, title, keywords FROM socialmedia.messages WHERE edited_at > '2023-12-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Get author_id, edited_at, zip_code, display_name by joining messages with users.", "sql": null}, {"role": "assistant", "content": "SELECT *, users.zip_code, users.display_name FROM socialmedia.messages JOIN socialmedia.users ON messages.user_id = users.user_id;", "sql": null}, {"role": "user", "content": "Get min of message by keywords from messages.", "sql": null}, {"role": "assistant", "content": "SELECT keywords, MIN(message) AS min_message FROM socialmedia.messages GROUP BY keywords;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "What are the reserved, available, manufacturer of each group?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, available, manufacturer FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Arrange the results with reserved in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, available, manufacturer FROM socialmedia.groups ORDER BY reserved DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, available, manufacturer FROM socialmedia.groups ORDER BY reserved DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Get all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Can you order these by reserved ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY reserved ASC;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY reserved ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Show me all groups.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by video_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.groups ORDER BY video_url ASC;", "sql": null}, {"role": "user", "content": "Count the number of groups in each user_id category.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(*) AS count FROM socialmedia.groups GROUP BY user_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "List all messages.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages;", "sql": null}, {"role": "user", "content": "Retrieve messages where the date is created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.messages WHERE edited_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Get the distribution of messages across different title values.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM socialmedia.messages GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.messages (\n id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n message varchar NOT NULL,\n parent_id character varying(64),\n title character varying(128) NOT NULL,\n views character varying(128),\n author_id text NOT NULL -- identifier for author,\n keywords character varying(128),\n user_id text -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.groups (\n barcode character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n video_url character varying(64),\n msrp character varying(256),\n rating character varying(256),\n reserved char,\n manufacturer character varying(64),\n available character varying(128) NOT NULL,\n user_id text NOT NULL -- reference to users.user_id,\n FOREIGN KEY (user_id) REFERENCES users(user_id)\n)\n\nCREATE TABLE socialmedia.users (\n user_id text PRIMARY KEY -- unique identifier,\n created_at date,\n last_active timestamp without time zone,\n timezone character varying(64) NOT NULL,\n display_name char,\n membership_level character varying(256),\n zip_code varchar,\n account_status varchar,\n last_name char,\n language char\n)", "conversations": [{"role": "user", "content": "Retrieve updated_at, user_id, rating for every group.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, rating FROM socialmedia.groups;", "sql": null}, {"role": "user", "content": "Order the output by user_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, rating FROM socialmedia.groups ORDER BY user_id ASC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, user_id, rating FROM socialmedia.groups ORDER BY user_id ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Show me quantity, product_id, expires_at for all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, product_id, expires_at FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, product_id, expires_at FROM e-commerce.inventory WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT quantity, product_id, expires_at FROM e-commerce.inventory WHERE manufacturer LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "What are the product_id, expires_at, description of each inventory?", "sql": null}, {"role": "assistant", "content": "SELECT product_id, expires_at, description FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Get inventory that match product_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, expires_at, description FROM e-commerce.inventory WHERE product_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different description values.", "sql": null}, {"role": "assistant", "content": "SELECT description, COUNT(*) AS count FROM e-commerce.inventory GROUP BY description ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get description, featured_rank, quantity from all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, quantity FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by manufacturer descending.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, quantity FROM e-commerce.inventory ORDER BY manufacturer DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT description, featured_rank, quantity FROM e-commerce.inventory ORDER BY manufacturer DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Show me thumbnail, attachment_url, categories for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, attachment_url, categories FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by attachment_url descending?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, attachment_url, categories FROM e-commerce.reviews ORDER BY attachment_url DESC;", "sql": null}, {"role": "user", "content": "What is the average categories for each edited_at in reviews?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, AVERAGE(categories) AS average_categories FROM e-commerce.reviews GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Show the results sorted by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY product_id DESC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY product_id DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Retrieve rating, product_id, featured_rank for every inventory.", "sql": null}, {"role": "assistant", "content": "SELECT rating, product_id, featured_rank FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have featured_rank LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT rating, product_id, featured_rank FROM e-commerce.inventory WHERE featured_rank LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, product_id, featured_rank FROM e-commerce.inventory WHERE featured_rank LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Show me edited_at, categories, thumbnail for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, thumbnail FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Can you order these by attachment_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, thumbnail FROM e-commerce.reviews ORDER BY attachment_url ASC;", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, categories, thumbnail FROM e-commerce.reviews ORDER BY attachment_url ASC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Show me reviews with edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show the results sorted by attachment_url ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE edited_at > '2023-01-01' ORDER BY attachment_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Get all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews that have views LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE views LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.reviews WHERE views LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n edited_at date,\n views varchar,\n categories text NOT NULL,\n user_id character varying(256),\n attachment_url character varying(256),\n thumbnail char\n)\n\nCREATE TABLE e-commerce.inventory (\n product_id character varying(64) NOT NULL -- unique identifier,\n expires_at date,\n description text,\n manufacturer text,\n featured_rank char,\n rating character varying(64) NOT NULL,\n quantity char\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "List inventory that have rating LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE rating LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of inventory across different expires_at values.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(*) AS count FROM e-commerce.inventory GROUP BY expires_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n cost numeric(38,14),\n featured_rank char,\n category character varying(128),\n order_id text NOT NULL -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating varchar NOT NULL,\n name varchar,\n description varchar NOT NULL,\n cost decimal,\n discount smallint,\n image_url text,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n buyer_id character varying(128) -- identifier for buyer,\n subtotal bigint,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at date,\n currency character varying(256) NOT NULL,\n exchange_rate character varying(256),\n amount numeric(38,14),\n payment_status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by description descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory ORDER BY description DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n cost numeric(38,14),\n featured_rank char,\n category character varying(128),\n order_id text NOT NULL -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating varchar NOT NULL,\n name varchar,\n description varchar NOT NULL,\n cost decimal,\n discount smallint,\n image_url text,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n buyer_id character varying(128) -- identifier for buyer,\n subtotal bigint,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at date,\n currency character varying(256) NOT NULL,\n exchange_rate character varying(256),\n amount numeric(38,14),\n payment_status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.orders;", "sql": null}, {"role": "user", "content": "What shippin_id, buyer_id, cost, category do we have for orders and their associated shipping?", "sql": null}, {"role": "assistant", "content": "SELECT *, shipping.cost, shipping.category FROM e-commerce.orders JOIN e-commerce.shipping ON orders.shippin_id = shipping.barcode;", "sql": null}, {"role": "user", "content": "Tally up orders by buyer_id.", "sql": null}, {"role": "assistant", "content": "SELECT buyer_id, COUNT(*) AS count FROM e-commerce.orders GROUP BY buyer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n cost numeric(38,14),\n featured_rank char,\n category character varying(128),\n order_id text NOT NULL -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating varchar NOT NULL,\n name varchar,\n description varchar NOT NULL,\n cost decimal,\n discount smallint,\n image_url text,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n buyer_id character varying(128) -- identifier for buyer,\n subtotal bigint,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at date,\n currency character varying(256) NOT NULL,\n exchange_rate character varying(256),\n amount numeric(38,14),\n payment_status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all inventory.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory;", "sql": null}, {"role": "user", "content": "Find inventory where name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.inventory WHERE name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group inventory by discount and show the sum of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT discount, SUM(updated_at) AS sum_updated_at FROM e-commerce.inventory GROUP BY discount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n barcode integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n cost numeric(38,14),\n featured_rank char,\n category character varying(128),\n order_id text NOT NULL -- reference to orders.id,\n FOREIGN KEY (order_id) REFERENCES orders(id)\n)\n\nCREATE TABLE e-commerce.inventory (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n rating varchar NOT NULL,\n name varchar,\n description varchar NOT NULL,\n cost decimal,\n discount smallint,\n image_url text,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.orders (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp without time zone,\n seller_id text NOT NULL -- identifier for seller,\n buyer_id character varying(128) -- identifier for buyer,\n subtotal bigint,\n shippin_id integer -- reference to shipping.barcode,\n FOREIGN KEY (shippin_id) REFERENCES shipping(barcode)\n)\n\nCREATE TABLE e-commerce.order_items (\n id character varying(64) NOT NULL -- unique identifier,\n traded_at timestamp without time zone,\n completed_at date,\n currency character varying(256) NOT NULL,\n exchange_rate character varying(256),\n amount numeric(38,14),\n payment_status character varying(64) NOT NULL\n)", "conversations": [{"role": "user", "content": "List created_at, cost, category from shipping.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, cost, category FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List shipping that have published_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, cost, category FROM e-commerce.shipping WHERE published_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of shipping in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM e-commerce.shipping GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get bio, inventor_id, discount, published_at by joining users with inventory.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.discount, inventory.published_at FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by bio.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM e-commerce.users GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Get all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by bio.", "sql": null}, {"role": "assistant", "content": "SELECT bio, COUNT(*) AS count FROM e-commerce.users GROUP BY bio ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Sort the results by country descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Get the distribution of users across different salt values.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM e-commerce.users GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Retrieve users where last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of users grouped by salt.", "sql": null}, {"role": "assistant", "content": "SELECT salt, COUNT(*) AS count FROM e-commerce.users GROUP BY salt ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Show me all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me salt, user_id, created_at, discount from users and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.created_at, inventory.discount FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Get average of user_id by salt from users.", "sql": null}, {"role": "assistant", "content": "SELECT salt, AVERAGE(user_id) AS average_user_id FROM e-commerce.users GROUP BY salt;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Get country, bio, inventor_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT country, bio, inventor_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me users with user_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT country, bio, inventor_id FROM e-commerce.users WHERE user_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT country, bio, inventor_id FROM e-commerce.users WHERE user_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "What are the last_active, country, inventor_id of each user?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, country, inventor_id FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Get users that match last_login > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, country, inventor_id FROM e-commerce.users WHERE last_login > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of users in each last_active category.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, COUNT(*) AS count FROM e-commerce.users GROUP BY last_active ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Display all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Show me salt, inventor_id, published_at, video_url from users and their related inventory.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.published_at, inventory.video_url FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Calculate average of country for each salt in users.", "sql": null}, {"role": "assistant", "content": "SELECT salt, AVERAGE(country) AS average_country FROM e-commerce.users GROUP BY salt;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve country, inventor_id, last_active for every user.", "sql": null}, {"role": "assistant", "content": "SELECT country, inventor_id, last_active FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "Find users modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT country, inventor_id, last_active FROM e-commerce.users WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT country, inventor_id, last_active FROM e-commerce.users WHERE last_active >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.inventory (\n barcode text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n published_at date,\n video_url character varying(256) -- identifier for video_url,\n discount smallint,\n quantity character varying(128),\n thumbnail_url char NOT NULL\n)\n\nCREATE TABLE e-commerce.order_items (\n invoice_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n completed_at timestamp without time zone,\n customer_id character varying(256) -- identifier for customer,\n delivery_status character varying(128),\n product_id varchar,\n amount smallint\n)\n\nCREATE TABLE e-commerce.users (\n user_id character varying(64) NOT NULL -- unique identifier,\n last_active date,\n last_login timestamp,\n country character varying(64),\n salt char,\n bio text,\n inventor_id text -- reference to inventory.barcode,\n FOREIGN KEY (inventor_id) REFERENCES inventory(barcode)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.users;", "sql": null}, {"role": "user", "content": "What country, last_active, published_at, video_url do we have for users and their associated inventory?", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.published_at, inventory.video_url FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT *, inventory.published_at, inventory.video_url FROM e-commerce.users JOIN e-commerce.inventory ON users.inventor_id = inventory.barcode LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "List all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Get title, author_id, cancelled_at, traded_at by joining posts with followers.", "sql": null}, {"role": "assistant", "content": "SELECT *, followers.cancelled_at, followers.traded_at FROM socialmedia.posts JOIN socialmedia.followers ON posts.follower_id = followers.transaction_id;", "sql": null}, {"role": "user", "content": "What is the min author_id for each thumbnail in posts?", "sql": null}, {"role": "assistant", "content": "SELECT thumbnail, MIN(author_id) AS min_author_id FROM socialmedia.posts GROUP BY thumbnail;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get title, author_id, body from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, body FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by author_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, body FROM socialmedia.posts ORDER BY author_id ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT title, author_id, body FROM socialmedia.posts ORDER BY author_id ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Show me author_id, comment_id, message for all posts.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, comment_id, message FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, comment_id, message FROM socialmedia.posts ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, comment_id, message FROM socialmedia.posts ORDER BY created_at DESC LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "List author_id, thumbnail, body from posts.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, thumbnail, body FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Find posts where author_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, thumbnail, body FROM socialmedia.posts WHERE author_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by message descending?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, thumbnail, body FROM socialmedia.posts WHERE author_id LIKE 'A%' ORDER BY message DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "What are the published_at, author_id, follower_id of each post?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, follower_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Sort the results by author_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, follower_id FROM socialmedia.posts ORDER BY author_id ASC;", "sql": null}, {"role": "user", "content": "Show the results sorted by message descending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, author_id, follower_id FROM socialmedia.posts ORDER BY message DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get author_id, body, comment_id from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, body, comment_id FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Retrieve posts where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, body, comment_id FROM socialmedia.posts WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Arrange the results with message in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, body, comment_id FROM socialmedia.posts WHERE created_at > '2023-01-01' ORDER BY message DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Order the output by message ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY message ASC;", "sql": null}, {"role": "user", "content": "How many posts are there per published_at?", "sql": null}, {"role": "assistant", "content": "SELECT published_at, COUNT(*) AS count FROM socialmedia.posts GROUP BY published_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Get published_at, message, title from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message, title FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Order the output by author_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message, title FROM socialmedia.posts ORDER BY author_id ASC;", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT published_at, message, title FROM socialmedia.posts ORDER BY author_id ASC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "What are the message, created_at, thumbnail of each post?", "sql": null}, {"role": "assistant", "content": "SELECT message, created_at, thumbnail FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "What message, created_at, card_type, customer_id do we have for posts and their associated followers?", "sql": null}, {"role": "assistant", "content": "SELECT message, created_at, thumbnail, followers.card_type, followers.customer_id FROM socialmedia.posts JOIN socialmedia.followers ON posts.follower_id = followers.transaction_id;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT message, created_at, thumbnail, followers.card_type, followers.customer_id FROM socialmedia.posts JOIN socialmedia.followers ON posts.follower_id = followers.transaction_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.posts (\n comment_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at timestamp without time zone,\n message character varying(256),\n author_id char -- identifier for author,\n title character varying(64),\n thumbnail character varying(128) NOT NULL,\n body text,\n follower_id integer -- reference to followers.transaction_id,\n FOREIGN KEY (follower_id) REFERENCES followers(transaction_id)\n)\n\nCREATE TABLE socialmedia.followers (\n transaction_id integer PRIMARY KEY -- unique identifier,\n cancelled_at timestamp without time zone,\n traded_at timestamp without time zone,\n amount decimal,\n customer_id character varying(256) -- identifier for customer,\n card_type char\n)", "conversations": [{"role": "user", "content": "Display all posts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts;", "sql": null}, {"role": "user", "content": "Can you order these by published_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.posts ORDER BY published_at ASC;", "sql": null}, {"role": "user", "content": "Calculate sum of message for each comment_id in posts.", "sql": null}, {"role": "assistant", "content": "SELECT comment_id, SUM(message) AS sum_message FROM socialmedia.posts GROUP BY comment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many departments are there per type?", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM healthcare.departments GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE updated_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Get the distribution of departments across different medical_record_id values.", "sql": null}, {"role": "assistant", "content": "SELECT medical_record_id, COUNT(*) AS count FROM healthcare.departments GROUP BY medical_record_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "List type, country, name from departments.", "sql": null}, {"role": "assistant", "content": "SELECT type, country, name FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "What updated_at, location_lat, payment_status, delivery_status do we have for departments and their associated medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT type, country, name, medical_records.payment_status, medical_records.delivery_status FROM healthcare.departments JOIN healthcare.medical_records ON departments.medical_record_id = medical_records.order_id;", "sql": null}, {"role": "user", "content": "Can you order these by updated_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT type, country, name, medical_records.payment_status, medical_records.delivery_status FROM healthcare.departments JOIN healthcare.medical_records ON departments.medical_record_id = medical_records.order_id ORDER BY updated_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by longitude descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY longitude DESC;", "sql": null}, {"role": "user", "content": "Count the number of departments in each type category.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(*) AS count FROM healthcare.departments GROUP BY type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve location_lat, updated_at, longitude for every department.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, updated_at, longitude FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments with longitude LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, updated_at, longitude FROM healthcare.departments WHERE longitude LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up departments by location_lat.", "sql": null}, {"role": "assistant", "content": "SELECT location_lat, COUNT(*) AS count FROM healthcare.departments GROUP BY location_lat ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Sort the results by geo_point ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments ORDER BY geo_point ASC;", "sql": null}, {"role": "user", "content": "Calculate average of name for each name in departments.", "sql": null}, {"role": "assistant", "content": "SELECT name, AVERAGE(name) AS average_name FROM healthcare.departments GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, name, type of each department?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, name, type FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Get departments that match doctor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, name, type FROM healthcare.departments WHERE doctor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up departments by longitude.", "sql": null}, {"role": "assistant", "content": "SELECT longitude, COUNT(*) AS count FROM healthcare.departments GROUP BY longitude ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "List departments that have state LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE state LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE state LIKE 'A%' ORDER BY updated_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve country, name, doctor_id for every department.", "sql": null}, {"role": "assistant", "content": "SELECT country, name, doctor_id FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT country, name, doctor_id FROM healthcare.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by type ascending.", "sql": null}, {"role": "assistant", "content": "SELECT country, name, doctor_id FROM healthcare.departments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n venue_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n name varchar,\n type char,\n location_lat character varying(64),\n country char,\n geo_point character varying(64),\n state text NOT NULL,\n longitude text,\n medical_record_id text -- reference to medical_records.order_id,\n doctor_id text -- reference to doctors.post_id,\n FOREIGN KEY (medical_record_id) REFERENCES medical_records(order_id),\n FOREIGN KEY (doctor_id) REFERENCES doctors(post_id)\n)\n\nCREATE TABLE healthcare.doctors (\n post_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n views text,\n message character varying(256),\n attachment_url character varying(256),\n title character varying(128),\n tags char,\n reply_to_id char -- identifier for reply_to\n)\n\nCREATE TABLE healthcare.medical_records (\n order_id varchar PRIMARY KEY -- unique identifier,\n cancelled_at date,\n delivery_status text,\n quantity character varying(64),\n card_type varchar,\n payment_status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments;", "sql": null}, {"role": "user", "content": "Show me departments with doctor_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE doctor_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.departments WHERE doctor_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n person_id varchar PRIMARY KEY -- unique identifier,\n last_active timestamp,\n website text NOT NULL,\n membership_level char,\n last_login date NOT NULL,\n password_hash char NOT NULL,\n country varchar NOT NULL,\n nationality character varying(64) NOT NULL,\n is_verified bit NOT NULL -- indicates if verified is true,\n course_id text -- reference to courses.comment_id,\n grade_id text -- reference to grades.transaction_id,\n FOREIGN KEY (course_id) REFERENCES courses(comment_id),\n FOREIGN KEY (grade_id) REFERENCES grades(transaction_id)\n)\n\nCREATE TABLE education.grades (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n processed_at date,\n customer_id character varying(256),\n payer_id character varying(256),\n description varchar NOT NULL,\n notes character varying(128),\n category text\n)\n\nCREATE TABLE education.courses (\n comment_id varchar PRIMARY KEY -- unique identifier,\n edited_at date,\n created_at timestamp,\n media_url character varying(256),\n thumbnail text NOT NULL,\n shares varchar,\n reply_to_id char NOT NULL -- identifier for reply_to\n)\n\nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n birth_date date NOT NULL,\n website text,\n is_active boolean,\n token varchar,\n phone character varying(64),\n state char,\n age character varying(64),\n course_id text NOT NULL -- reference to courses.comment_id,\n FOREIGN KEY (course_id) REFERENCES courses(comment_id)\n)", "conversations": [{"role": "user", "content": "Show me all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Get students that match birth_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE birth_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE birth_date > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n profile_picture_url char NOT NULL,\n language character varying(128),\n bio character varying(64),\n token text,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE events.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n views character varying(128) NOT NULL,\n title character varying(128),\n image_url text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE events.products (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n price bigint NOT NULL,\n views varchar,\n thumbnail_url character varying(256) NOT NULL,\n brand char,\n rating character varying(256),\n backorder varchar,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE events.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp,\n reconciliation_status varchar NOT NULL,\n approval_status character varying(256),\n status char,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Get product_id, updated_at, token from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, updated_at, token FROM events.patients;", "sql": null}, {"role": "user", "content": "Show me patients with token LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, updated_at, token FROM events.patients WHERE token LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 20 records.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, updated_at, token FROM events.patients WHERE token LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n profile_picture_url char NOT NULL,\n language character varying(128),\n bio character varying(64),\n token text,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE events.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n views character varying(128) NOT NULL,\n title character varying(128),\n image_url text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE events.products (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n price bigint NOT NULL,\n views varchar,\n thumbnail_url character varying(256) NOT NULL,\n brand char,\n rating character varying(256),\n backorder varchar,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE events.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp,\n reconciliation_status varchar NOT NULL,\n approval_status character varying(256),\n status char,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, language, product_id of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, language, product_id FROM events.patients;", "sql": null}, {"role": "user", "content": "Find patients older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, language, product_id FROM events.patients WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get min of bio by updated_at from patients.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(bio) AS min_bio FROM events.patients GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n profile_picture_url char NOT NULL,\n language character varying(128),\n bio character varying(64),\n token text,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE events.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n views character varying(128) NOT NULL,\n title character varying(128),\n image_url text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE events.products (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n price bigint NOT NULL,\n views varchar,\n thumbnail_url character varying(256) NOT NULL,\n brand char,\n rating character varying(256),\n backorder varchar,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE events.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp,\n reconciliation_status varchar NOT NULL,\n approval_status character varying(256),\n status char,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.patients;", "sql": null}, {"role": "user", "content": "Sort the results by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.patients ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM events.patients ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE events.patients (\n user_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n profile_picture_url char NOT NULL,\n language character varying(128),\n bio character varying(64),\n token text,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)\n\nCREATE TABLE events.messages (\n content_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n published_at timestamp without time zone,\n views character varying(128) NOT NULL,\n title character varying(128),\n image_url text,\n patient_id integer NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE events.products (\n sku varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n price bigint NOT NULL,\n views varchar,\n thumbnail_url character varying(256) NOT NULL,\n brand char,\n rating character varying(256),\n backorder varchar,\n message_id text NOT NULL -- reference to messages.content_id,\n FOREIGN KEY (message_id) REFERENCES messages(content_id)\n)\n\nCREATE TABLE events.accounts (\n account_id text PRIMARY KEY -- unique identifier,\n created_at timestamp,\n processed_at timestamp,\n reconciliation_status varchar NOT NULL,\n approval_status character varying(256),\n status char,\n product_id text -- reference to products.sku,\n FOREIGN KEY (product_id) REFERENCES products(sku)\n)", "conversations": [{"role": "user", "content": "Get approval_status, status, product_id from all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, product_id FROM events.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT approval_status, status, product_id FROM events.accounts WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of accounts in each product_id category.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(*) AS count FROM events.accounts GROUP BY product_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "What are the price, processed_at, tax of each transaction?", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, tax FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Can you order these by currency ascending?", "sql": null}, {"role": "assistant", "content": "SELECT price, processed_at, tax FROM restaurant.transactions ORDER BY currency ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of transactions across different currency values.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM restaurant.transactions GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Show me first_name, birth_date, last_login for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, birth_date, last_login FROM restaurant.patients;", "sql": null}, {"role": "user", "content": "Retrieve last_login, created_at, keywords, edited_at showing the relationship between patients and posts.", "sql": null}, {"role": "assistant", "content": "SELECT first_name, birth_date, last_login, posts.keywords, posts.edited_at FROM restaurant.patients JOIN restaurant.posts ON patients.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Show me the count of patients grouped by post_id.", "sql": null}, {"role": "assistant", "content": "SELECT post_id, COUNT(*) AS count FROM restaurant.patients GROUP BY post_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "List attachment_url, keywords, reply_to_id from posts.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, keywords, reply_to_id FROM restaurant.posts;", "sql": null}, {"role": "user", "content": "Get posts that match reply_to_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, keywords, reply_to_id FROM restaurant.posts WHERE reply_to_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT attachment_url, keywords, reply_to_id FROM restaurant.posts WHERE reply_to_id LIKE 'A%' ORDER BY author_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Get last_login, birth_date, joined_at from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, birth_date, joined_at FROM restaurant.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT last_login, birth_date, joined_at FROM restaurant.patients ORDER BY post_id ASC;", "sql": null}, {"role": "user", "content": "Count the number of patients in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM restaurant.patients GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "List all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Get price, post_id, author_id, updated_at by joining transactions with posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.author_id, posts.updated_at FROM restaurant.transactions JOIN restaurant.posts ON transactions.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "What is the sum currency for each currency in transactions?", "sql": null}, {"role": "assistant", "content": "SELECT currency, SUM(currency) AS sum_currency FROM restaurant.transactions GROUP BY currency;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Get reply_to_id, attachment_url, format from all posts.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, attachment_url, format FROM restaurant.posts;", "sql": null}, {"role": "user", "content": "Show me posts with reply_to_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, attachment_url, format FROM restaurant.posts WHERE reply_to_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of posts in each author_id category.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, COUNT(*) AS count FROM restaurant.posts GROUP BY author_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.patients;", "sql": null}, {"role": "user", "content": "Show me birth_date, joined_at, transaction_id, attachment_url from patients and their related posts.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.transaction_id, posts.attachment_url FROM restaurant.patients JOIN restaurant.posts ON patients.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.transaction_id, posts.attachment_url FROM restaurant.patients JOIN restaurant.posts ON patients.post_id = posts.message_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "What are the created_at, last_login, membership_level of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_login, membership_level FROM restaurant.patients;", "sql": null}, {"role": "user", "content": "Sort the results by birth_date ascending.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_login, membership_level FROM restaurant.patients ORDER BY birth_date ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 5 items.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_login, membership_level FROM restaurant.patients ORDER BY birth_date ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Retrieve subtotal, post_id, processed_at for every transaction.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, post_id, processed_at FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "Retrieve currency, post_id, keywords, updated_at showing the relationship between transactions and posts.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, post_id, processed_at, posts.keywords, posts.updated_at FROM restaurant.transactions JOIN restaurant.posts ON transactions.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, post_id, processed_at, posts.keywords, posts.updated_at FROM restaurant.transactions JOIN restaurant.posts ON transactions.post_id = posts.message_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.transactions (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n created_at date,\n currency varchar NOT NULL,\n tax bigint,\n price integer NOT NULL,\n subtotal numeric,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)\n\nCREATE TABLE restaurant.posts (\n message_id text PRIMARY KEY -- unique identifier,\n edited_at date,\n updated_at date,\n format character varying(64),\n reply_to_id text -- identifier for reply_to,\n keywords character varying(128),\n image_url char,\n author_id text NOT NULL,\n attachment_url text NOT NULL,\n transaction_id text -- reference to transactions.payment_id,\n FOREIGN KEY (transaction_id) REFERENCES transactions(payment_id)\n)\n\nCREATE TABLE restaurant.patients (\n employee_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n first_name character varying(128),\n last_login timestamp,\n membership_level char,\n birth_date timestamp without time zone,\n post_id text -- reference to posts.message_id,\n FOREIGN KEY (post_id) REFERENCES posts(message_id)\n)", "conversations": [{"role": "user", "content": "Get all transactions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.transactions;", "sql": null}, {"role": "user", "content": "What currency, subtotal, edited_at, keywords do we have for transactions and their associated posts?", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.edited_at, posts.keywords FROM restaurant.transactions JOIN restaurant.posts ON transactions.post_id = posts.message_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by post_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, posts.edited_at, posts.keywords FROM restaurant.transactions JOIN restaurant.posts ON transactions.post_id = posts.message_id ORDER BY post_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me expires_at, categorie_id, msrp for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, categorie_id, msrp FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, categorie_id, msrp FROM e-commerce.shipping WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up shipping by msrp.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, COUNT(*) AS count FROM e-commerce.shipping GROUP BY msrp ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me average of msrp grouped by categorie_id for shipping.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, AVERAGE(msrp) AS average_msrp FROM e-commerce.shipping GROUP BY categorie_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Sort the results by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY expires_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me msrp, currency, expires_at for all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, currency, expires_at FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where price > 43.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, currency, expires_at FROM e-commerce.shipping WHERE price > 43;", "sql": null}, {"role": "user", "content": "Show me the count of shipping grouped by featured_rank.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM e-commerce.shipping GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get message, reply_to_id, likes from all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT message, reply_to_id, likes FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "List reviews with dates from last week.", "sql": null}, {"role": "assistant", "content": "SELECT message, reply_to_id, likes FROM e-commerce.reviews WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of reviews across different message values.", "sql": null}, {"role": "assistant", "content": "SELECT message, COUNT(*) AS count FROM e-commerce.reviews GROUP BY message ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the likes, reply_to_id, created_at of each review?", "sql": null}, {"role": "assistant", "content": "SELECT likes, reply_to_id, created_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with categorie_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT likes, reply_to_id, created_at FROM e-commerce.reviews ORDER BY categorie_id ASC;", "sql": null}, {"role": "user", "content": "What is the average keywords for each reply_to_id in reviews?", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, AVERAGE(keywords) AS average_keywords FROM e-commerce.reviews GROUP BY reply_to_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.shipping (\n item_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n expires_at timestamp,\n price bigint,\n name character varying(64),\n thumbnail_url character varying(64),\n currency varchar,\n msrp character varying(256),\n featured_rank text,\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n review_id integer NOT NULL -- reference to reviews.message_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id),\n FOREIGN KEY (review_id) REFERENCES reviews(message_id)\n)\n\nCREATE TABLE e-commerce.categories (\n transaction_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n price decimal,\n product_id character varying(64) -- identifier for product,\n quantity character varying(64),\n exchange_rate character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.reviews (\n message_id integer PRIMARY KEY -- unique identifier,\n created_at date,\n reply_to_id character varying(256) -- identifier for reply_to,\n keywords character varying(64) NOT NULL,\n message character varying(256),\n likes character varying(256),\n categorie_id integer NOT NULL -- reference to categories.transaction_id,\n FOREIGN KEY (categorie_id) REFERENCES categories(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me reply_to_id, likes, created_at for all reviews.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, likes, created_at FROM e-commerce.reviews;", "sql": null}, {"role": "user", "content": "Arrange the results with message in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT reply_to_id, likes, created_at FROM e-commerce.reviews ORDER BY message ASC;", "sql": null}, {"role": "user", "content": "Tally up reviews by categorie_id.", "sql": null}, {"role": "assistant", "content": "SELECT categorie_id, COUNT(*) AS count FROM e-commerce.reviews GROUP BY categorie_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List amount, payment_id, reconciliation_status from prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT amount, payment_id, reconciliation_status FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Get all prescriptions created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT amount, payment_id, reconciliation_status FROM healthcare.prescriptions WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Show me the count of prescriptions grouped by reconciliation_status.", "sql": null}, {"role": "assistant", "content": "SELECT reconciliation_status, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY reconciliation_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me due_date, payment_id, amount for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payment_id, amount FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Retrieve prescriptions where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, payment_id, amount FROM healthcare.prescriptions WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me processed_at, due_date, reconciliation_status for all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, due_date, reconciliation_status FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions where reconciliation_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, due_date, reconciliation_status FROM healthcare.prescriptions WHERE reconciliation_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by amount ascending.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, due_date, reconciliation_status FROM healthcare.prescriptions WHERE reconciliation_status LIKE 'A%' ORDER BY amount ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Display all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Arrange the results with processed_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY processed_at DESC;", "sql": null}, {"role": "user", "content": "Show only 25 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions ORDER BY processed_at DESC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "List all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by shares ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY shares ASC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY shares ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me created_at, author_id, shares for all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, author_id, shares FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Find medical_records created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, author_id, shares FROM healthcare.medical_records WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, author_id, shares FROM healthcare.medical_records WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by author_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records ORDER BY author_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of medical_records grouped by created_at.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Retrieve amount, processed_at, due_date for every prescription.", "sql": null}, {"role": "assistant", "content": "SELECT amount, processed_at, due_date FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Show me prescriptions with payment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT amount, processed_at, due_date FROM healthcare.prescriptions WHERE payment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT amount, processed_at, due_date FROM healthcare.prescriptions WHERE payment_id LIKE 'A%' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions;", "sql": null}, {"role": "user", "content": "Find prescriptions between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.prescriptions WHERE due_date BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of prescriptions across different due_date values.", "sql": null}, {"role": "assistant", "content": "SELECT due_date, COUNT(*) AS count FROM healthcare.prescriptions GROUP BY due_date ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n content_id text PRIMARY KEY -- unique identifier,\n created_at date,\n author_id character varying(128) NOT NULL,\n shares text\n)\n\nCREATE TABLE healthcare.prescriptions (\n payment_id character varying(64) NOT NULL -- unique identifier,\n processed_at date,\n due_date date,\n reconciliation_status char,\n amount numeric(38,14)\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match content_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE content_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by message descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE content_id LIKE 'A%' ORDER BY message DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the student_id, author_id, message of each assignment?", "sql": null}, {"role": "assistant", "content": "SELECT student_id, author_id, message FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments that were created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, author_id, message FROM education.assignments WHERE edited_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Tally up assignments by edited_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM education.assignments GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show the results sorted by views ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY views ASC;", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments ORDER BY created_at ASC;", "sql": null}, {"role": "user", "content": "How many assignments are there per message?", "sql": null}, {"role": "assistant", "content": "SELECT message, COUNT(*) AS count FROM education.assignments GROUP BY message ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me message, author_id, membership_level, password_hash from assignments and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.membership_level, students.password_hash FROM education.assignments JOIN education.students ON assignments.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Limit the results to 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.membership_level, students.password_hash FROM education.assignments JOIN education.students ON assignments.student_id = students.person_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get author_id, student_id, edited_at from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, student_id, edited_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Can you order these by edited_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT author_id, student_id, edited_at FROM education.assignments ORDER BY edited_at ASC;", "sql": null}, {"role": "user", "content": "Get the distribution of assignments across different message values.", "sql": null}, {"role": "assistant", "content": "SELECT message, COUNT(*) AS count FROM education.assignments GROUP BY message ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve views, content_id, edited_at for every assignment.", "sql": null}, {"role": "assistant", "content": "SELECT views, content_id, edited_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me edited_at, created_at, display_name, membership_level from assignments and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT views, content_id, edited_at, students.display_name, students.membership_level FROM education.assignments JOIN education.students ON assignments.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Calculate min of student_id for each created_at in assignments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(student_id) AS min_student_id FROM education.assignments GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List student_id, views, created_at from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, views, created_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get all assignments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, views, created_at FROM education.assignments WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Count the number of assignments in each student_id category.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.assignments GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get author_id, student_id, content_id from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, student_id, content_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me message, author_id, password_hash, display_name from assignments and their related students.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, student_id, content_id, students.password_hash, students.display_name FROM education.assignments JOIN education.students ON assignments.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Show me min of content_id grouped by edited_at for assignments.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, MIN(content_id) AS min_content_id FROM education.assignments GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n content_id character varying(64) NOT NULL -- unique identifier,\n edited_at date,\n created_at timestamp without time zone,\n message text,\n views char NOT NULL,\n author_id char,\n student_id text NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.students (\n person_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n password_hash char,\n is_verified bit NOT NULL -- indicates if verified is true,\n display_name text NOT NULL,\n first_name character varying(128),\n last_login timestamp,\n membership_level varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "Get assignments that match student_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE student_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate average of edited_at for each content_id in assignments.", "sql": null}, {"role": "assistant", "content": "SELECT content_id, AVERAGE(edited_at) AS average_edited_at FROM education.assignments GROUP BY content_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE restaurant.addresses (\n location_id text PRIMARY KEY -- unique identifier,\n last_inspected timestamp,\n created_at timestamp without time zone,\n location_lon text,\n location_lat char,\n timezone character varying(64),\n operating_hours character varying(128),\n street character varying(64),\n type character varying(128),\n geo_point varchar\n)\n\nCREATE TABLE restaurant.clients (\n id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n phone varchar NOT NULL,\n full_name char,\n is_verified boolean NOT NULL -- indicates if verified is true,\n account_status varchar NOT NULL,\n nationality text,\n status text NOT NULL,\n avatar varchar\n)\n\nCREATE TABLE restaurant.items (\n id character varying(64) NOT NULL -- unique identifier,\n expires_at timestamp,\n created_at date,\n backorder char,\n featured_rank character varying(128),\n brand character varying(128),\n video_url character varying(256) NOT NULL,\n views character varying(256),\n category character varying(256),\n addresse_id text NOT NULL -- reference to addresses.location_id,\n FOREIGN KEY (addresse_id) REFERENCES addresses(location_id)\n)\n\nCREATE TABLE restaurant.messages (\n comment_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp without time zone,\n reply_to_id varchar,\n user_id varchar NOT NULL -- identifier for user,\n image_url varchar NOT NULL,\n subject character varying(256) NOT NULL,\n categories varchar NOT NULL,\n media_url character varying(64),\n title varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.items;", "sql": null}, {"role": "user", "content": "Retrieve items where backorder LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.items WHERE backorder LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM restaurant.items WHERE backorder LIKE 'A%' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "What are the reference_number, payment_date, user_id of each account?", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, user_id FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match amount > 36.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, user_id FROM finance.accounts WHERE amount > 36;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, payment_date, user_id FROM finance.accounts WHERE amount > 36 ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Show me created_at, bio, nationality for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, bio, nationality FROM finance.customers;", "sql": null}, {"role": "user", "content": "List membership_level, created_at, parent_id, user_id for each customer along with their audit information.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, bio, nationality, audits.parent_id, audits.user_id FROM finance.customers JOIN finance.audits ON customers.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, bio, nationality, audits.parent_id, audits.user_id FROM finance.customers JOIN finance.audits ON customers.audit_id = audits.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with audit_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE created_at > '2023-12-01' ORDER BY audit_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Get min of audit_id by reference_number from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT reference_number, MIN(audit_id) AS min_audit_id FROM finance.accounts GROUP BY reference_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Get all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "What reference_number, processed_at, author_id, created_at do we have for accounts and their associated audits?", "sql": null}, {"role": "assistant", "content": "SELECT *, audits.author_id, audits.created_at FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "Calculate count of payment_date for each user_id in accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, COUNT(payment_date) AS count_payment_date FROM finance.accounts GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match bio LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE bio LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different language values.", "sql": null}, {"role": "assistant", "content": "SELECT language, COUNT(*) AS count FROM finance.customers GROUP BY language ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Retrieve audit_id, payment_date, reference_number for every account.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, payment_date, reference_number FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match payment_date > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, payment_date, reference_number FROM finance.accounts WHERE payment_date > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group accounts by amount and show the count of user_id.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(user_id) AS count_user_id FROM finance.accounts GROUP BY amount;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "List user_id, audit_id, amount from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, audit_id, amount FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get accounts that match audit_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, audit_id, amount FROM finance.accounts WHERE audit_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with user_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, audit_id, amount FROM finance.accounts WHERE audit_id LIKE 'A%' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Get audit_id, membership_level, full_name from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, membership_level, full_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "Sort the results by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, membership_level, full_name FROM finance.customers ORDER BY language DESC;", "sql": null}, {"role": "user", "content": "Calculate max of nationality for each audit_id in customers.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, MAX(nationality) AS max_nationality FROM finance.customers GROUP BY audit_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n bio char NOT NULL,\n full_name character varying(128),\n nationality char,\n language text,\n membership_level character varying(64),\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n payment_date timestamp without time zone,\n amount smallint NOT NULL,\n user_id text -- identifier for user,\n reference_number char NOT NULL,\n audit_id text NOT NULL -- reference to audits.id,\n FOREIGN KEY (audit_id) REFERENCES audits(id)\n)\n\nCREATE TABLE finance.audits (\n id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n user_id character varying(64),\n author_id character varying(128) -- identifier for author,\n parent_id varchar\n)", "conversations": [{"role": "user", "content": "Retrieve id, membership_level, full_name for every customer.", "sql": null}, {"role": "assistant", "content": "SELECT id, membership_level, full_name FROM finance.customers;", "sql": null}, {"role": "user", "content": "What nationality, bio, user_id, created_at do we have for customers and their associated audits?", "sql": null}, {"role": "assistant", "content": "SELECT id, membership_level, full_name, audits.user_id, audits.created_at FROM finance.customers JOIN finance.audits ON customers.audit_id = audits.id;", "sql": null}, {"role": "user", "content": "Calculate min of membership_level for each created_at in customers.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, MIN(membership_level) AS min_membership_level FROM finance.customers GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "What are the reserved, msrp, customer_id of each item?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, customer_id FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Show me items with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, customer_id FROM humanresources.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by published_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, msrp, customer_id FROM humanresources.items WHERE description LIKE 'A%' ORDER BY published_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Get items that match subcategory LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items WHERE subcategory LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show me the count of items grouped by popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(*) AS count FROM humanresources.items GROUP BY popularity_score ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Display all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Show me items with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 10 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items WHERE description LIKE 'A%' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "List items with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "How many items are there per customer_id?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM humanresources.items GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "What are the reserved, manufacturer, published_at of each item?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, manufacturer, published_at FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Find items where msrp LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT reserved, manufacturer, published_at FROM humanresources.items WHERE msrp LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of published_at by msrp from items.", "sql": null}, {"role": "assistant", "content": "SELECT msrp, AVERAGE(published_at) AS average_published_at FROM humanresources.items GROUP BY msrp;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Retrieve updated_at, msrp, birth_date, is_active showing the relationship between items and customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.birth_date, customers.is_active FROM humanresources.items JOIN humanresources.customers ON items.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Show me the count of items grouped by popularity_score.", "sql": null}, {"role": "assistant", "content": "SELECT popularity_score, COUNT(*) AS count FROM humanresources.items GROUP BY popularity_score ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "List description, msrp, reserved from items.", "sql": null}, {"role": "assistant", "content": "SELECT description, msrp, reserved FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Find items created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT description, msrp, reserved FROM humanresources.items WHERE published_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Count the number of items in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM humanresources.items GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "List all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Show me customer_id, updated_at, last_active, email from items and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_active, customers.email FROM humanresources.items JOIN humanresources.customers ON items.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.last_active, customers.email FROM humanresources.items JOIN humanresources.customers ON items.customer_id = customers.customer_id LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Show me all items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.items;", "sql": null}, {"role": "user", "content": "Show me customer_id, subcategory, joined_at, is_active from items and their related customers.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.is_active FROM humanresources.items JOIN humanresources.customers ON items.customer_id = customers.customer_id;", "sql": null}, {"role": "user", "content": "Order the output by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT *, customers.joined_at, customers.is_active FROM humanresources.items JOIN humanresources.customers ON items.customer_id = customers.customer_id ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.items (\n item_id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n published_at date,\n popularity_score character varying(64),\n manufacturer varchar,\n msrp varchar,\n reserved character varying(256),\n description char,\n subcategory character varying(128),\n customer_id integer NOT NULL -- reference to customers.customer_id,\n FOREIGN KEY (customer_id) REFERENCES customers(customer_id)\n)\n\nCREATE TABLE humanresources.customers (\n customer_id integer PRIMARY KEY -- unique identifier,\n last_active timestamp,\n joined_at date,\n birth_date timestamp,\n email character varying(64),\n avatar character varying(128),\n is_active boolean\n)", "conversations": [{"role": "user", "content": "Retrieve subcategory, customer_id, popularity_score for every item.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, customer_id, popularity_score FROM humanresources.items;", "sql": null}, {"role": "user", "content": "List items that have manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, customer_id, popularity_score FROM humanresources.items WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by msrp descending.", "sql": null}, {"role": "assistant", "content": "SELECT subcategory, customer_id, popularity_score FROM humanresources.items WHERE manufacturer LIKE 'A%' ORDER BY msrp DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the country, account_status, zip_code of each medical_record?", "sql": null}, {"role": "assistant", "content": "SELECT country, account_status, zip_code FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Order the output by zip_code ascending.", "sql": null}, {"role": "assistant", "content": "SELECT country, account_status, zip_code FROM healthcare.medical_records ORDER BY zip_code ASC;", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each doctor_id category.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.medical_records GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records with account_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE account_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by account_status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE account_status LIKE 'A%' ORDER BY account_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the min account_status for each country in medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT country, MIN(account_status) AS min_account_status FROM healthcare.medical_records GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me country, doctor_id, customer_id for all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT country, doctor_id, customer_id FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Sort the results by customer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT country, doctor_id, customer_id FROM healthcare.medical_records ORDER BY customer_id ASC;", "sql": null}, {"role": "user", "content": "Can you order these by customer_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT country, doctor_id, customer_id FROM healthcare.medical_records ORDER BY customer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Display all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Retrieve created_at, customer_id, amount, processed_at showing the relationship between medical_records and doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.amount, doctors.processed_at FROM healthcare.medical_records JOIN healthcare.doctors ON medical_records.doctor_id = doctors.transaction_id;", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each customer_id category.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, COUNT(*) AS count FROM healthcare.medical_records GROUP BY customer_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Get customer_id, account_status, zip_code from all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, account_status, zip_code FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "What customer_id, zip_code, price, amount do we have for medical_records and their associated doctors?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, account_status, zip_code, doctors.price, doctors.amount FROM healthcare.medical_records JOIN healthcare.doctors ON medical_records.doctor_id = doctors.transaction_id;", "sql": null}, {"role": "user", "content": "What is the count created_at for each zip_code in medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT zip_code, COUNT(created_at) AS count_created_at FROM healthcare.medical_records GROUP BY zip_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "List customer_id, account_status, country from medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, account_status, country FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Show me medical_records that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, account_status, country FROM healthcare.medical_records WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by account_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, account_status, country FROM healthcare.medical_records WHERE created_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY account_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "Get all medical_records from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the max customer_id for each customer_id in medical_records?", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, MAX(customer_id) AS max_customer_id FROM healthcare.medical_records GROUP BY customer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve account_status, customer_id, country for every medical_record.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, customer_id, country FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT account_status, customer_id, country FROM healthcare.medical_records WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each doctor_id category.", "sql": null}, {"role": "assistant", "content": "SELECT doctor_id, COUNT(*) AS count FROM healthcare.medical_records GROUP BY doctor_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.medical_records (\n customer_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp,\n account_status character varying(128),\n country text,\n zip_code text,\n doctor_id text -- reference to doctors.transaction_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(transaction_id)\n)\n\nCREATE TABLE healthcare.doctors (\n transaction_id text PRIMARY KEY -- unique identifier,\n processed_at date,\n updated_at date,\n exchange_rate text,\n status character varying(128) NOT NULL,\n amount bigint,\n price numeric NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all medical_records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records;", "sql": null}, {"role": "user", "content": "List medical_records with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.medical_records WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Count the number of medical_records in each created_at category.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.medical_records GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "List all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Order the output by employee_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers ORDER BY employee_id DESC;", "sql": null}, {"role": "user", "content": "Tally up customers by state.", "sql": null}, {"role": "assistant", "content": "SELECT state, COUNT(*) AS count FROM finance.customers GROUP BY state ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get membership_level, joined_at, employee_id from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM finance.customers;", "sql": null}, {"role": "user", "content": "Can you order these by joined_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM finance.customers ORDER BY joined_at DESC;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, joined_at, employee_id FROM finance.customers ORDER BY joined_at DESC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Display all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get all customers created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE updated_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Calculate sum of last_name for each employee_id in customers.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, SUM(last_name) AS sum_last_name FROM finance.customers GROUP BY employee_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me nationality, last_name, state for all customers.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, last_name, state FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get investment_id, last_name, updated_at, account_id by joining customers with investments.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, last_name, state, investments.updated_at, investments.account_id FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.payment_id;", "sql": null}, {"role": "user", "content": "What is the max joined_at for each last_name in customers?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, MAX(joined_at) AS max_joined_at FROM finance.customers GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Get nationality, membership_level, joined_at from all customers.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, membership_level, joined_at FROM finance.customers;", "sql": null}, {"role": "user", "content": "Show me customers that were created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT nationality, membership_level, joined_at FROM finance.customers WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "What is the max language for each last_name in customers?", "sql": null}, {"role": "assistant", "content": "SELECT last_name, MAX(language) AS max_language FROM finance.customers GROUP BY last_name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get nationality, joined_at, exchange_rate, account_id by joining customers with investments.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.exchange_rate, investments.account_id FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.payment_id;", "sql": null}, {"role": "user", "content": "Calculate max of language for each joined_at in customers.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(language) AS max_language FROM finance.customers GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List membership_level, updated_at, account_id, exchange_rate for each customer along with their investment information.", "sql": null}, {"role": "assistant", "content": "SELECT *, investments.account_id, investments.exchange_rate FROM finance.customers JOIN finance.investments ON customers.investment_id = investments.payment_id;", "sql": null}, {"role": "user", "content": "Tally up customers by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM finance.customers GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Show me all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "Get customers that match last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Arrange the results with nationality in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE last_name LIKE 'A%' ORDER BY nationality DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "Retrieve all customers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers;", "sql": null}, {"role": "user", "content": "List customers with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Order the output by language descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.customers WHERE joined_at > '2023-12-01' ORDER BY language DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.customers (\n employee_id character varying(64) NOT NULL -- unique identifier,\n joined_at date,\n updated_at timestamp,\n nationality character varying(64),\n language text,\n membership_level text,\n state character varying(128),\n last_name char NOT NULL,\n investment_id text NOT NULL -- reference to investments.payment_id,\n FOREIGN KEY (investment_id) REFERENCES investments(payment_id)\n)\n\nCREATE TABLE finance.investments (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n updated_at timestamp,\n exchange_rate character varying(128) NOT NULL,\n price decimal,\n account_id character varying(64) NOT NULL -- identifier for account,\n quantity character varying(128),\n customer_id text NOT NULL -- identifier for customer,\n status character varying(64)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, investment_id, language of each customer?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, investment_id, language FROM finance.customers;", "sql": null}, {"role": "user", "content": "Find customers where language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, investment_id, language FROM finance.customers WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of customers across different employee_id values.", "sql": null}, {"role": "assistant", "content": "SELECT employee_id, COUNT(*) AS count FROM finance.customers GROUP BY employee_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List timezone, asset_id, website from users.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, asset_id, website FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users with log_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT timezone, asset_id, website FROM tradingplatform.users WHERE log_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get average of last_name by city from users.", "sql": null}, {"role": "assistant", "content": "SELECT city, AVERAGE(last_name) AS average_last_name FROM tradingplatform.users GROUP BY city;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show me logs that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Can you order these by created_at descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get bio, country, asset_id from all users.", "sql": null}, {"role": "assistant", "content": "SELECT bio, country, asset_id FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT bio, country, asset_id FROM tradingplatform.users WHERE joined_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Calculate sum of country for each asset_id in users.", "sql": null}, {"role": "assistant", "content": "SELECT asset_id, SUM(country) AS sum_country FROM tradingplatform.users GROUP BY asset_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Display all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Retrieve logs where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Only show the top 15 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE created_at = CURRENT_DATE - INTERVAL '1 day' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "List image_url, featured_rank, created_at, geo_point for each asset along with their log information.", "sql": null}, {"role": "assistant", "content": "SELECT *, logs.created_at, logs.geo_point FROM tradingplatform.assets JOIN tradingplatform.logs ON assets.log_id = logs.location_id;", "sql": null}, {"role": "user", "content": "Get the distribution of assets across different featured_rank values.", "sql": null}, {"role": "assistant", "content": "SELECT featured_rank, COUNT(*) AS count FROM tradingplatform.assets GROUP BY featured_rank ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Sort the results by address_line1 ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY address_line1 ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY address_line1 ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "List city, asset_id, timezone from users.", "sql": null}, {"role": "assistant", "content": "SELECT city, asset_id, timezone FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "List users with dates created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT city, asset_id, timezone FROM tradingplatform.users WHERE joined_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "What is the sum log_id for each bio in users?", "sql": null}, {"role": "assistant", "content": "SELECT bio, SUM(log_id) AS sum_log_id FROM tradingplatform.users GROUP BY bio;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n product_id text PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at date,\n featured_rank text,\n image_url char,\n popularity_score char,\n msrp character varying(256),\n backorder char,\n video_url text,\n log_id text -- reference to logs.location_id,\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n last_name character varying(256) NOT NULL,\n bio character varying(128) NOT NULL,\n timezone char,\n nationality text,\n city varchar,\n country character varying(64),\n website char NOT NULL,\n asset_id text NOT NULL -- reference to assets.product_id,\n log_id text NOT NULL -- reference to logs.location_id,\n FOREIGN KEY (asset_id) REFERENCES assets(product_id),\n FOREIGN KEY (log_id) REFERENCES logs(location_id)\n)\n\nCREATE TABLE tradingplatform.logs (\n location_id varchar PRIMARY KEY -- unique identifier,\n last_inspected timestamp without time zone,\n created_at date,\n country varchar,\n address_line1 character varying(128),\n geo_point varchar,\n operating_hours text,\n user_id text NOT NULL -- reference to users.customer_id,\n FOREIGN KEY (user_id) REFERENCES users(customer_id)\n)", "conversations": [{"role": "user", "content": "Get all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Find logs between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs WHERE last_inspected BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Get the distribution of logs across different address_line1 values.", "sql": null}, {"role": "assistant", "content": "SELECT address_line1, COUNT(*) AS count FROM tradingplatform.logs GROUP BY address_line1 ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get products that match order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE order_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Sort the results by order_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products ORDER BY order_id DESC;", "sql": null}, {"role": "user", "content": "Tally up products by image_url.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM e-commerce.products GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Display all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where the date is created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show the results sorted by street ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE last_inspected = CURRENT_DATE - INTERVAL '1 day' ORDER BY street ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Retrieve shipping where operating_hours LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE operating_hours LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the average store_id for each postal_code in shipping?", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, AVERAGE(store_id) AS average_store_id FROM e-commerce.shipping GROUP BY postal_code;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "List store_id, postal_code, traded_at, quantity for each shipping along with their order information.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.traded_at, orders.quantity FROM e-commerce.shipping JOIN e-commerce.orders ON shipping.order_id = orders.payment_id;", "sql": null}, {"role": "user", "content": "Show only 5 records.", "sql": null}, {"role": "assistant", "content": "SELECT *, orders.traded_at, orders.quantity FROM e-commerce.shipping JOIN e-commerce.orders ON shipping.order_id = orders.payment_id LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "List image_url, published_at, expires_at from products.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, published_at, expires_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Get all products from last week.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, published_at, expires_at FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by user_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, published_at, expires_at FROM e-commerce.products WHERE published_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY user_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me id, discount, published_at for all products.", "sql": null}, {"role": "assistant", "content": "SELECT id, discount, published_at FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where expires_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT id, discount, published_at FROM e-commerce.products WHERE expires_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "How many products are there per reserved?", "sql": null}, {"role": "assistant", "content": "SELECT reserved, COUNT(*) AS count FROM e-commerce.products GROUP BY reserved ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get postal_code, store_id, street from all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, store_id, street FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Find shipping where order_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, store_id, street FROM e-commerce.shipping WHERE order_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT postal_code, store_id, street FROM e-commerce.shipping WHERE order_id LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Get all shipping.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping;", "sql": null}, {"role": "user", "content": "Show me shipping with store_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE store_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by postal_code descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.shipping WHERE store_id LIKE 'A%' ORDER BY postal_code DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE e-commerce.orders (\n payment_id varchar PRIMARY KEY -- unique identifier,\n traded_at timestamp,\n delivery_status character varying(256),\n approval_status char,\n discount decimal,\n quantity varchar,\n customer_id character varying(128) NOT NULL\n)\n\nCREATE TABLE e-commerce.users (\n employee_id varchar PRIMARY KEY -- unique identifier,\n last_active date,\n updated_at timestamp without time zone,\n language character varying(128),\n status character varying(256)\n)\n\nCREATE TABLE e-commerce.products (\n id character varying(64) NOT NULL -- unique identifier,\n published_at timestamp,\n expires_at timestamp,\n image_url varchar,\n discount decimal,\n reserved varchar,\n user_id text NOT NULL -- reference to users.employee_id,\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (user_id) REFERENCES users(employee_id),\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)\n\nCREATE TABLE e-commerce.shipping (\n store_id character varying(64) NOT NULL -- unique identifier,\n last_inspected date,\n created_at date,\n street character varying(128),\n postal_code character varying(128),\n operating_hours character varying(256),\n order_id text -- reference to orders.payment_id,\n FOREIGN KEY (order_id) REFERENCES orders(payment_id)\n)", "conversations": [{"role": "user", "content": "Show me all products.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products;", "sql": null}, {"role": "user", "content": "Retrieve products where reserved LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM e-commerce.products WHERE reserved LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate min of reserved for each image_url in products.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, MIN(reserved) AS min_reserved FROM e-commerce.products GROUP BY image_url;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "List students that have language LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE language LIKE 'A%';", "sql": null}, {"role": "user", "content": "Tally up students by country.", "sql": null}, {"role": "assistant", "content": "SELECT country, COUNT(*) AS count FROM education.students GROUP BY country ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Get all departments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments;", "sql": null}, {"role": "user", "content": "Find departments where student_id > 55.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.departments WHERE student_id > 55;", "sql": null}, {"role": "user", "content": "Show me min of latitude grouped by capacity for departments.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, MIN(latitude) AS min_latitude FROM education.departments GROUP BY capacity;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by country descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY country DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Show me students that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get max of country by updated_at from students.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MAX(country) AS max_country FROM education.students GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students;", "sql": null}, {"role": "user", "content": "Find students where is_active = TRUE.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.students WHERE is_active = TRUE;", "sql": null}, {"role": "user", "content": "Calculate sum of updated_at for each country in students.", "sql": null}, {"role": "assistant", "content": "SELECT country, SUM(updated_at) AS sum_updated_at FROM education.students GROUP BY country;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Show me capacity, type, latitude for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, type, latitude FROM education.departments;", "sql": null}, {"role": "user", "content": "Retrieve departments where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, type, latitude FROM education.departments WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of departments in each student_id category.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, COUNT(*) AS count FROM education.departments GROUP BY student_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "What are the operating_hours, latitude, created_at of each department?", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, latitude, created_at FROM education.departments;", "sql": null}, {"role": "user", "content": "Show the results sorted by updated_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, latitude, created_at FROM education.departments ORDER BY updated_at DESC;", "sql": null}, {"role": "user", "content": "Restrict the output to 100 items.", "sql": null}, {"role": "assistant", "content": "SELECT operating_hours, latitude, created_at FROM education.departments ORDER BY updated_at DESC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Show me capacity, student_id, created_at for all departments.", "sql": null}, {"role": "assistant", "content": "SELECT capacity, student_id, created_at FROM education.departments;", "sql": null}, {"role": "user", "content": "Can you order these by operating_hours descending?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, student_id, created_at FROM education.departments ORDER BY operating_hours DESC;", "sql": null}, {"role": "user", "content": "Can you order these by type ascending?", "sql": null}, {"role": "assistant", "content": "SELECT capacity, student_id, created_at FROM education.departments ORDER BY type ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.students (\n person_id integer PRIMARY KEY -- unique identifier,\n updated_at date,\n created_at timestamp,\n timezone character varying(64),\n account_status varchar,\n is_active boolean,\n country text NOT NULL,\n language char NOT NULL,\n course_id text NOT NULL -- reference to courses.address_id,\n FOREIGN KEY (course_id) REFERENCES courses(address_id)\n)\n\nCREATE TABLE education.departments (\n store_id varchar PRIMARY KEY -- unique identifier,\n created_at date,\n updated_at timestamp without time zone,\n operating_hours character varying(256) NOT NULL,\n type char,\n capacity char,\n latitude character varying(64) NOT NULL,\n student_id integer NOT NULL -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)\n\nCREATE TABLE education.teachers (\n comment_id character varying(64) NOT NULL -- unique identifier,\n updated_at date,\n edited_at timestamp without time zone,\n author_id varchar,\n text text NOT NULL,\n subject varchar,\n body character varying(128) NOT NULL,\n media_url char NOT NULL\n)\n\nCREATE TABLE education.courses (\n address_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n coordinates text NOT NULL,\n country char,\n capacity varchar\n)", "conversations": [{"role": "user", "content": "Get latitude, updated_at, type from all departments.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, updated_at, type FROM education.departments;", "sql": null}, {"role": "user", "content": "Show me departments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT latitude, updated_at, type FROM education.departments WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Group departments by type and show the count of type.", "sql": null}, {"role": "assistant", "content": "SELECT type, COUNT(type) AS count_type FROM education.departments GROUP BY type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by fee descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY fee DESC;", "sql": null}, {"role": "user", "content": "Return just 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY fee DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Can you order these by delivery_status ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY delivery_status ASC;", "sql": null}, {"role": "user", "content": "Order the output by fee ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits ORDER BY fee ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "What are the fee, delivery_status, cancelled_at of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT fee, delivery_status, cancelled_at FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT fee, delivery_status, cancelled_at FROM finance.audits WHERE created_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Can you order these by created_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT fee, delivery_status, cancelled_at FROM finance.audits WHERE created_at >= CURRENT_DATE - INTERVAL '30 days' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Find audits older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Get max of cancelled_at by fee from audits.", "sql": null}, {"role": "assistant", "content": "SELECT fee, MAX(cancelled_at) AS max_cancelled_at FROM finance.audits GROUP BY fee;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Display all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE cancelled_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List audit_id, reconciliation_status, created_at from accounts.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, reconciliation_status, created_at FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Get audit_id, created_at, currency, cancelled_at by joining accounts with audits.", "sql": null}, {"role": "assistant", "content": "SELECT audit_id, reconciliation_status, created_at, audits.currency, audits.cancelled_at FROM finance.accounts JOIN finance.audits ON accounts.audit_id = audits.transaction_id;", "sql": null}, {"role": "user", "content": "Get the distribution of accounts across different invoice_number values.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, COUNT(*) AS count FROM finance.accounts GROUP BY invoice_number ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "What are the currency, created_at, account_id of each audit?", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, account_id FROM finance.audits;", "sql": null}, {"role": "user", "content": "Get audits that match created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, account_id FROM finance.audits WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up audits by account_id.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, COUNT(*) AS count FROM finance.audits GROUP BY account_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Show me all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Find accounts created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts WHERE created_at > '2023-12-01' ORDER BY created_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Display all accounts.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts;", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.accounts ORDER BY created_at DESC;", "sql": null}, {"role": "user", "content": "Calculate count of invoice_number for each created_at in accounts.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(invoice_number) AS count_invoice_number FROM finance.accounts GROUP BY created_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.accounts (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n verification_status character varying(64) NOT NULL,\n invoice_number char,\n notes character varying(64),\n exchange_rate varchar NOT NULL,\n description character varying(64),\n reconciliation_status character varying(64) NOT NULL,\n audit_id text -- reference to audits.transaction_id,\n FOREIGN KEY (audit_id) REFERENCES audits(transaction_id)\n)\n\nCREATE TABLE finance.audits (\n transaction_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n cancelled_at date,\n fee char,\n delivery_status char,\n currency character varying(64),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List all audits.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits;", "sql": null}, {"role": "user", "content": "Retrieve audits where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.audits WHERE created_at > '2023-01-01' LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.departments (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at date,\n published_at timestamp without time zone,\n quantity character varying(256),\n title character varying(128) NOT NULL,\n msrp varchar,\n video_url text -- identifier for video_url,\n popularity_score character varying(128) NOT NULL,\n prescription_id text NOT NULL -- reference to prescriptions.invoice_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(invoice_id)\n)\n\nCREATE TABLE healthcare.patients (\n person_id character varying(64) NOT NULL -- unique identifier,\n created_at timestamp without time zone,\n updated_at date,\n gender text,\n zip_code text,\n salt char,\n country char,\n department_id text -- reference to departments.item_id,\n prescription_id text NOT NULL -- reference to prescriptions.invoice_id,\n FOREIGN KEY (department_id) REFERENCES departments(item_id),\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(invoice_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n updated_at date,\n approval_status character varying(128) NOT NULL,\n account_id char -- identifier for account,\n card_type char,\n currency varchar NOT NULL,\n payment_method char\n)\n\nCREATE TABLE healthcare.billing (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n payer_id character varying(64),\n customer_id character varying(256),\n balance bigint\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by country descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY country DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY country DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve appointment_id, created_at, first_name for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, created_at, first_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, created_at, first_name FROM healthcare.patients WHERE created_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Can you order these by first_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, created_at, first_name FROM healthcare.patients WHERE created_at >= CURRENT_DATE - INTERVAL '7 days' ORDER BY first_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get appointments that match shares LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE shares LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many appointments are there per edited_at?", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, COUNT(*) AS count FROM healthcare.appointments GROUP BY edited_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show the results sorted by appointment_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY appointment_id ASC;", "sql": null}, {"role": "user", "content": "Tally up patients by joined_at.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, COUNT(*) AS count FROM healthcare.patients GROUP BY joined_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE joined_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get min of joined_at by joined_at from patients.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MIN(joined_at) AS min_joined_at FROM healthcare.patients GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, subject, tags of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subject, tags FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Retrieve appointments where the date is between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subject, tags FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Order the output by visibility descending.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subject, tags FROM healthcare.appointments WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY visibility DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n user_id varchar PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at date,\n status varchar NOT NULL,\n first_name character varying(256),\n appointment_id text -- reference to appointments.content_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id)\n)\n\nCREATE TABLE healthcare.appointments (\n content_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n edited_at timestamp without time zone,\n shares char,\n tags character varying(256) NOT NULL,\n likes char NOT NULL,\n visibility char,\n description character varying(256) NOT NULL,\n text character varying(128),\n subject varchar NOT NULL,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)\n\nCREATE TABLE healthcare.departments (\n message_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n edited_at timestamp,\n reply_to_id character varying(128),\n format text,\n shares char,\n appointment_id text NOT NULL -- reference to appointments.content_id,\n patient_id text NOT NULL -- reference to patients.user_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(content_id),\n FOREIGN KEY (patient_id) REFERENCES patients(user_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get tags, description, appointment_id, created_at by joining appointments with patients.", "sql": null}, {"role": "assistant", "content": "SELECT *, patients.appointment_id, patients.created_at FROM healthcare.appointments JOIN healthcare.patients ON appointments.patient_id = patients.user_id;", "sql": null}, {"role": "user", "content": "Show me the count of appointments grouped by text.", "sql": null}, {"role": "assistant", "content": "SELECT text, COUNT(*) AS count FROM healthcare.appointments GROUP BY text ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "What are the payment_status, approval_status, cancelled_at of each payment?", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, approval_status, cancelled_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments that have status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, approval_status, cancelled_at FROM finance.payments WHERE status LIKE 'A%';", "sql": null}, {"role": "user", "content": "How many payments are there per exchange_rate?", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, COUNT(*) AS count FROM finance.payments GROUP BY exchange_rate ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get customer_id, payment_status, cancelled_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_status, cancelled_at FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by account_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT customer_id, payment_status, cancelled_at FROM finance.payments ORDER BY account_id DESC;", "sql": null}, {"role": "user", "content": "Show me the count of payments grouped by amount.", "sql": null}, {"role": "assistant", "content": "SELECT amount, COUNT(*) AS count FROM finance.payments GROUP BY amount ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get amount, status, currency, category by joining payments with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.currency, accounts.category FROM finance.payments JOIN finance.accounts ON payments.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Show the results sorted by payment_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.currency, accounts.category FROM finance.payments JOIN finance.accounts ON payments.account_id = accounts.id ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get status, customer_id, exchange_rate from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, exchange_rate FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by cancelled_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, exchange_rate FROM finance.payments ORDER BY cancelled_at DESC;", "sql": null}, {"role": "user", "content": "Show the results sorted by cancelled_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT status, customer_id, exchange_rate FROM finance.payments ORDER BY cancelled_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve account_id, payment_status, status for every payment.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payment_status, status FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get payments that match exchange_rate LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payment_status, status FROM finance.payments WHERE exchange_rate LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT account_id, payment_status, status FROM finance.payments WHERE exchange_rate LIKE 'A%' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "List payments with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Arrange the results with exchange_rate in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months' ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Retrieve all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY exchange_rate ASC;", "sql": null}, {"role": "user", "content": "Calculate average of customer_id for each status in payments.", "sql": null}, {"role": "assistant", "content": "SELECT status, AVERAGE(customer_id) AS average_customer_id FROM finance.payments GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "Get exchange_rate, payment_status, amount from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_status, amount FROM finance.payments;", "sql": null}, {"role": "user", "content": "Find payments created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_status, amount FROM finance.payments WHERE cancelled_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Arrange the results with payment_status in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, payment_status, amount FROM finance.payments WHERE cancelled_at = CURRENT_DATE - INTERVAL '1 day' ORDER BY payment_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List exchange_rate, status, amount from payments.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, amount FROM finance.payments;", "sql": null}, {"role": "user", "content": "Sort the results by approval_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT exchange_rate, status, amount FROM finance.payments ORDER BY approval_status DESC;", "sql": null}, {"role": "user", "content": "Tally up payments by payment_status.", "sql": null}, {"role": "assistant", "content": "SELECT payment_status, COUNT(*) AS count FROM finance.payments GROUP BY payment_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.transactions (\n transaction_id text PRIMARY KEY -- unique identifier,\n traded_at timestamp without time zone,\n completed_at timestamp,\n product_id varchar NOT NULL -- identifier for product,\n quantity character varying(64),\n exchange_rate varchar,\n payment_method character varying(256),\n subtotal bigint NOT NULL,\n account_id varchar\n)\n\nCREATE TABLE finance.accounts (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n created_at date,\n reconciliation_status text,\n category character varying(128),\n currency varchar,\n credit char,\n payee_id varchar -- identifier for payee\n)\n\nCREATE TABLE finance.payments (\n id integer PRIMARY KEY -- unique identifier,\n cancelled_at date,\n exchange_rate text,\n amount integer,\n approval_status char,\n payment_status character varying(256) NOT NULL,\n status varchar,\n customer_id character varying(256),\n account_id text -- reference to accounts.id,\n FOREIGN KEY (account_id) REFERENCES accounts(id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Get amount, status, category, reconciliation_status by joining payments with accounts.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.category, accounts.reconciliation_status FROM finance.payments JOIN finance.accounts ON payments.account_id = accounts.id;", "sql": null}, {"role": "user", "content": "Return just 15 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, accounts.category, accounts.reconciliation_status FROM finance.payments JOIN finance.accounts ON payments.account_id = accounts.id LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Retrieve patients where created_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE created_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Tally up patients by full_name.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, COUNT(*) AS count FROM healthcare.patients GROUP BY full_name ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me full_name, prescription_id, last_active for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, prescription_id, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get all patients modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, prescription_id, last_active FROM healthcare.patients WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "How many patients are there per created_at?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, COUNT(*) AS count FROM healthcare.patients GROUP BY created_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Find patients where last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Can you order these by last_name ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE last_name LIKE 'A%' ORDER BY last_name ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Retrieve created_at, full_name, last_active for every patient.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, last_active FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Show me patients that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, last_active FROM healthcare.patients WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Return just 10 rows.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, full_name, last_active FROM healthcare.patients WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31' LIMIT 10;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "List all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Arrange the results with last_active in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY last_active ASC;", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY last_active ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Get full_name, last_active, prescription_id from all patients.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_active, prescription_id FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Get patients that match last_name LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_active, prescription_id FROM healthcare.patients WHERE last_name LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT full_name, last_active, prescription_id FROM healthcare.patients WHERE last_name LIKE 'A%' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have website LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE website LIKE 'A%';", "sql": null}, {"role": "user", "content": "Restrict the output to 15 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients WHERE website LIKE 'A%' LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "What are the created_at, last_active, last_name of each patient?", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_active, last_name FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "List patients that have last_active > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_active, last_name FROM healthcare.patients WHERE last_active > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, last_active, last_name FROM healthcare.patients WHERE last_active > '2023-01-01' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me all patients.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "Order the output by last_active descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY last_active DESC;", "sql": null}, {"role": "user", "content": "Can you order these by last_active descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.patients ORDER BY last_active DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.patients (\n person_id text PRIMARY KEY -- unique identifier,\n last_active date,\n created_at date,\n website character varying(256),\n full_name varchar,\n last_name char,\n prescription_id text -- reference to prescriptions.account_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(account_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n account_id text PRIMARY KEY -- unique identifier,\n due_date date,\n created_at date,\n customer_id character varying(128),\n verification_status char,\n reference_number varchar NOT NULL\n)", "conversations": [{"role": "user", "content": "Show me last_active, prescription_id, created_at for all patients.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, prescription_id, created_at FROM healthcare.patients;", "sql": null}, {"role": "user", "content": "What last_active, created_at, due_date, reference_number do we have for patients and their associated prescriptions?", "sql": null}, {"role": "assistant", "content": "SELECT last_active, prescription_id, created_at, prescriptions.due_date, prescriptions.reference_number FROM healthcare.patients JOIN healthcare.prescriptions ON patients.prescription_id = prescriptions.account_id;", "sql": null}, {"role": "user", "content": "Sort the results by last_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, prescription_id, created_at, prescriptions.due_date, prescriptions.reference_number FROM healthcare.patients JOIN healthcare.prescriptions ON patients.prescription_id = prescriptions.account_id ORDER BY last_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me author_id, categories, rating for all comments.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, categories, rating FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Retrieve comments where image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, categories, rating FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Limit the results to 100 rows.", "sql": null}, {"role": "assistant", "content": "SELECT author_id, categories, rating FROM socialmedia.comments WHERE image_url LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Sort the results by rating ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY rating ASC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY rating ASC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE updated_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Count the number of comments in each parent_id category.", "sql": null}, {"role": "assistant", "content": "SELECT parent_id, COUNT(*) AS count FROM socialmedia.comments GROUP BY parent_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get updated_at, parent_id, categories from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, parent_id, categories FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Find comments where categories LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, parent_id, categories FROM socialmedia.comments WHERE categories LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group comments by rating and show the sum of image_url.", "sql": null}, {"role": "assistant", "content": "SELECT rating, SUM(image_url) AS sum_image_url FROM socialmedia.comments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Show me all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "List comments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE created_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Calculate min of categories for each rating in comments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, MIN(categories) AS min_categories FROM socialmedia.comments GROUP BY rating;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments that were from last week.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Show only 50 records.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE updated_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "List categories, created_at, user_id from comments.", "sql": null}, {"role": "assistant", "content": "SELECT categories, created_at, user_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Can you order these by parent_id ascending?", "sql": null}, {"role": "assistant", "content": "SELECT categories, created_at, user_id FROM socialmedia.comments ORDER BY parent_id ASC;", "sql": null}, {"role": "user", "content": "Show only 15 records.", "sql": null}, {"role": "assistant", "content": "SELECT categories, created_at, user_id FROM socialmedia.comments ORDER BY parent_id ASC LIMIT 15;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Display all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show the results sorted by content_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY content_id DESC;", "sql": null}, {"role": "user", "content": "Return just 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments ORDER BY content_id DESC LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Get rating, content_id, author_id from all comments.", "sql": null}, {"role": "assistant", "content": "SELECT rating, content_id, author_id FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Arrange the results with author_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT rating, content_id, author_id FROM socialmedia.comments ORDER BY author_id ASC;", "sql": null}, {"role": "user", "content": "Restrict the output to 25 items.", "sql": null}, {"role": "assistant", "content": "SELECT rating, content_id, author_id FROM socialmedia.comments ORDER BY author_id ASC LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE socialmedia.comments (\n content_id character varying(64) NOT NULL -- unique identifier,\n updated_at timestamp,\n created_at date,\n author_id character varying(256),\n user_id varchar,\n parent_id varchar -- identifier for parent,\n rating character varying(64) NOT NULL,\n categories character varying(64),\n image_url varchar\n)\n\nCREATE TABLE socialmedia.messages (\n message_id character varying(64) NOT NULL -- unique identifier,\n created_at date,\n published_at date,\n tags character varying(64) NOT NULL,\n likes text,\n categories character varying(256),\n media_url character varying(128) NOT NULL,\n score character varying(64),\n user_id character varying(128) NOT NULL -- identifier for user\n)", "conversations": [{"role": "user", "content": "Retrieve all comments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments;", "sql": null}, {"role": "user", "content": "Show me comments with image_url LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM socialmedia.comments WHERE image_url LIKE 'A%';", "sql": null}, {"role": "user", "content": "Count the number of comments in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM socialmedia.comments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get doctor_id, currency, brand, expires_at by joining appointments with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.brand, doctors.expires_at FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id;", "sql": null}, {"role": "user", "content": "Show the results sorted by created_at descending.", "sql": null}, {"role": "assistant", "content": "SELECT *, doctors.brand, doctors.expires_at FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "List currency, doctor_id, payment_status from appointments.", "sql": null}, {"role": "assistant", "content": "SELECT currency, doctor_id, payment_status FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get payment_status, currency, name, appointment_id by joining appointments with doctors.", "sql": null}, {"role": "assistant", "content": "SELECT currency, doctor_id, payment_status, doctors.name, doctors.appointment_id FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id;", "sql": null}, {"role": "user", "content": "Arrange the results with doctor_id in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, doctor_id, payment_status, doctors.name, doctors.appointment_id FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id ORDER BY doctor_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me image_url, expires_at, appointment_id for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, expires_at, appointment_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Find doctors created yesterday.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, expires_at, appointment_id FROM healthcare.doctors WHERE expires_at = CURRENT_DATE - INTERVAL '1 day';", "sql": null}, {"role": "user", "content": "Show me sum of appointment_id grouped by name for doctors.", "sql": null}, {"role": "assistant", "content": "SELECT name, SUM(appointment_id) AS sum_appointment_id FROM healthcare.doctors GROUP BY name;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Find appointments from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with currency in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE completed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY currency DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the completed_at, payment_status, created_at of each appointment?", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, created_at FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Show me payment_status, approval_status, manufacturer, expires_at from appointments and their related doctors.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, created_at, doctors.manufacturer, doctors.expires_at FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id;", "sql": null}, {"role": "user", "content": "Order the output by doctor_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT completed_at, payment_status, created_at, doctors.manufacturer, doctors.expires_at FROM healthcare.appointments JOIN healthcare.doctors ON appointments.doctor_id = doctors.item_id ORDER BY doctor_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get appointments that match completed_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.appointments WHERE completed_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Show me the count of appointments grouped by currency.", "sql": null}, {"role": "assistant", "content": "SELECT currency, COUNT(*) AS count FROM healthcare.appointments GROUP BY currency ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me manufacturer, appointment_id, brand for all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, appointment_id, brand FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Retrieve doctors where appointment_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT manufacturer, appointment_id, brand FROM healthcare.doctors WHERE appointment_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "What is the min appointment_id for each appointment_id in doctors?", "sql": null}, {"role": "assistant", "content": "SELECT appointment_id, MIN(appointment_id) AS min_appointment_id FROM healthcare.doctors GROUP BY appointment_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by expires_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY expires_at ASC;", "sql": null}, {"role": "user", "content": "Can you order these by image_url ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY image_url ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me doctors with manufacturer LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors WHERE manufacturer LIKE 'A%';", "sql": null}, {"role": "user", "content": "Group doctors by expires_at and show the count of image_url.", "sql": null}, {"role": "assistant", "content": "SELECT expires_at, COUNT(image_url) AS count_image_url FROM healthcare.doctors GROUP BY expires_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.appointments (\n transaction_id text PRIMARY KEY -- unique identifier,\n completed_at date,\n created_at date,\n payment_status character varying(256),\n approval_status varchar NOT NULL,\n currency text NOT NULL,\n doctor_id text NOT NULL -- reference to doctors.item_id,\n FOREIGN KEY (doctor_id) REFERENCES doctors(item_id)\n)\n\nCREATE TABLE healthcare.doctors (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp without time zone,\n manufacturer character varying(128),\n image_url text NOT NULL,\n brand character varying(128) NOT NULL,\n name character varying(256) NOT NULL,\n appointment_id text -- reference to appointments.transaction_id,\n FOREIGN KEY (appointment_id) REFERENCES appointments(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me created_at, doctor_id, approval_status for all appointments.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, doctor_id, approval_status FROM healthcare.appointments;", "sql": null}, {"role": "user", "content": "Get all appointments created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, doctor_id, approval_status FROM healthcare.appointments WHERE created_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Arrange the results with created_at in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT created_at, doctor_id, approval_status FROM healthcare.appointments WHERE created_at > '2023-12-01' ORDER BY created_at DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.subscriptions;", "sql": null}, {"role": "user", "content": "Can you order these by currency descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.subscriptions ORDER BY currency DESC;", "sql": null}, {"role": "user", "content": "Get sum of payer_id by updated_at from subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, SUM(payer_id) AS sum_payer_id FROM humanresources.subscriptions GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Display all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "List articles with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by subscription_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY subscription_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, subscription_id, edited_at of each article?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subscription_id, edited_at FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Show me edited_at, score, payer_id, currency from articles and their related subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subscription_id, edited_at, subscriptions.payer_id, subscriptions.currency FROM humanresources.articles JOIN humanresources.subscriptions ON articles.subscription_id = subscriptions.invoice_id;", "sql": null}, {"role": "user", "content": "Limit the results to 20 rows.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, subscription_id, edited_at, subscriptions.payer_id, subscriptions.currency FROM humanresources.articles JOIN humanresources.subscriptions ON articles.subscription_id = subscriptions.invoice_id LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Get all subscriptions.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.subscriptions;", "sql": null}, {"role": "user", "content": "List subscriptions that have currency LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.subscriptions WHERE currency LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.subscriptions WHERE currency LIKE 'A%' ORDER BY product_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Can you order these by format descending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles ORDER BY format DESC;", "sql": null}, {"role": "user", "content": "Sort the results by format ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles ORDER BY format ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Retrieve articles where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Arrange the results with subscription_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE edited_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY subscription_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Get articles that match score LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE score LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by subscription_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE score LIKE 'A%' ORDER BY subscription_id DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve format, edited_at, score for every article.", "sql": null}, {"role": "assistant", "content": "SELECT format, edited_at, score FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Show the results sorted by subscription_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT format, edited_at, score FROM humanresources.articles ORDER BY subscription_id DESC;", "sql": null}, {"role": "user", "content": "Get min of format by updated_at from articles.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(format) AS min_format FROM humanresources.articles GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all articles.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Show me articles with edited_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM humanresources.articles WHERE edited_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group articles by updated_at and show the min of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, MIN(updated_at) AS min_updated_at FROM humanresources.articles GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE humanresources.articles (\n comment_id integer PRIMARY KEY -- unique identifier,\n edited_at timestamp,\n updated_at timestamp without time zone,\n media_url text NOT NULL,\n format character varying(128),\n score character varying(64),\n subscription_id text -- reference to subscriptions.invoice_id,\n FOREIGN KEY (subscription_id) REFERENCES subscriptions(invoice_id)\n)\n\nCREATE TABLE humanresources.products (\n item_id varchar PRIMARY KEY -- unique identifier,\n expires_at timestamp,\n published_at timestamp,\n msrp char NOT NULL,\n image_url char,\n cost integer\n)\n\nCREATE TABLE humanresources.subscriptions (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n updated_at date,\n debit character varying(256),\n credit varchar NOT NULL,\n user_id varchar,\n payer_id text -- identifier for payer,\n currency varchar,\n product_id text NOT NULL -- reference to products.item_id,\n FOREIGN KEY (product_id) REFERENCES products(item_id)\n)", "conversations": [{"role": "user", "content": "List subscription_id, score, updated_at from articles.", "sql": null}, {"role": "assistant", "content": "SELECT subscription_id, score, updated_at FROM humanresources.articles;", "sql": null}, {"role": "user", "content": "Get articles that match updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT subscription_id, score, updated_at FROM humanresources.articles WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Group articles by edited_at and show the max of updated_at.", "sql": null}, {"role": "assistant", "content": "SELECT edited_at, MAX(updated_at) AS max_updated_at FROM humanresources.articles GROUP BY edited_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Show me product_id, invoice_id, created_at, category from doctors and their related prescriptions.", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.created_at, prescriptions.category FROM healthcare.doctors JOIN healthcare.prescriptions ON doctors.prescription_id = prescriptions.transaction_id;", "sql": null}, {"role": "user", "content": "Tally up doctors by seller_id.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, COUNT(*) AS count FROM healthcare.doctors GROUP BY seller_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "List all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "What notes, prescription_id, category, amount do we have for billing and their associated prescriptions?", "sql": null}, {"role": "assistant", "content": "SELECT *, prescriptions.category, prescriptions.amount FROM healthcare.billing JOIN healthcare.prescriptions ON billing.prescription_id = prescriptions.transaction_id;", "sql": null}, {"role": "user", "content": "What is the min prescription_id for each payer_id in billing?", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, MIN(prescription_id) AS min_prescription_id FROM healthcare.billing GROUP BY payer_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Arrange the results with seller_id in descending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY seller_id DESC;", "sql": null}, {"role": "user", "content": "Tally up doctors by subtotal.", "sql": null}, {"role": "assistant", "content": "SELECT subtotal, COUNT(*) AS count FROM healthcare.doctors GROUP BY subtotal ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all billing.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Find billing where payer_id LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE payer_id LIKE 'A%';", "sql": null}, {"role": "user", "content": "Order the output by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.billing WHERE payer_id LIKE 'A%' ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the payer_id, notes, prescription_id of each billing?", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, notes, prescription_id FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Retrieve billing where the date is from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, notes, prescription_id FROM healthcare.billing WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Order the output by payer_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT payer_id, notes, prescription_id FROM healthcare.billing WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31' ORDER BY payer_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the prescription_id, subtotal, tax of each doctor?", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, subtotal, tax FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Sort the results by seller_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT prescription_id, subtotal, tax FROM healthcare.doctors ORDER BY seller_id DESC;", "sql": null}, {"role": "user", "content": "Show me average of payment_method grouped by tax for doctors.", "sql": null}, {"role": "assistant", "content": "SELECT tax, AVERAGE(payment_method) AS average_payment_method FROM healthcare.doctors GROUP BY tax;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve credit, prescription_id, processed_at for every billing.", "sql": null}, {"role": "assistant", "content": "SELECT credit, prescription_id, processed_at FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "Can you order these by prescription_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT credit, prescription_id, processed_at FROM healthcare.billing ORDER BY prescription_id DESC;", "sql": null}, {"role": "user", "content": "How many billing are there per notes?", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM healthcare.billing GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "List cancelled_at, prescription_id, invoice_id from doctors.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, prescription_id, invoice_id FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "List doctors with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT cancelled_at, prescription_id, invoice_id FROM healthcare.doctors WHERE cancelled_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Show me max of subtotal grouped by seller_id for doctors.", "sql": null}, {"role": "assistant", "content": "SELECT seller_id, MAX(subtotal) AS max_subtotal FROM healthcare.doctors GROUP BY seller_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all doctors.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors;", "sql": null}, {"role": "user", "content": "Order the output by product_id descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM healthcare.doctors ORDER BY product_id DESC;", "sql": null}, {"role": "user", "content": "Group doctors by product_id and show the count of subtotal.", "sql": null}, {"role": "assistant", "content": "SELECT product_id, COUNT(subtotal) AS count_subtotal FROM healthcare.doctors GROUP BY product_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE healthcare.billing (\n payment_id text PRIMARY KEY -- unique identifier,\n processed_at timestamp,\n payer_id char NOT NULL -- identifier for payer,\n credit char,\n notes character varying(256),\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)\n\nCREATE TABLE healthcare.prescriptions (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at timestamp without time zone,\n category character varying(256),\n amount smallint,\n currency varchar NOT NULL\n)\n\nCREATE TABLE healthcare.departments (\n store_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n address_line1 character varying(64),\n operating_hours character varying(64),\n country char,\n category varchar\n)\n\nCREATE TABLE healthcare.doctors (\n invoice_id character varying(64) NOT NULL -- unique identifier,\n cancelled_at timestamp,\n tax decimal,\n product_id character varying(128),\n payment_method character varying(64),\n seller_id character varying(64) NOT NULL,\n subtotal smallint,\n prescription_id text -- reference to prescriptions.transaction_id,\n FOREIGN KEY (prescription_id) REFERENCES prescriptions(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get processed_at, payer_id, notes from all billing.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payer_id, notes FROM healthcare.billing;", "sql": null}, {"role": "user", "content": "List billing with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, payer_id, notes FROM healthcare.billing WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "How many billing are there per notes?", "sql": null}, {"role": "assistant", "content": "SELECT notes, COUNT(*) AS count FROM healthcare.billing GROUP BY notes ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE finance.loans (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n due_date timestamp without time zone,\n payer_id character varying(64) -- identifier for payer,\n notes text NOT NULL,\n reference_number char,\n description character varying(256),\n customer_id integer NOT NULL -- reference to customers.employee_id,\n FOREIGN KEY (customer_id) REFERENCES customers(employee_id)\n)\n\nCREATE TABLE finance.accounts (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n payment_date timestamp without time zone,\n credit char,\n exchange_rate character varying(128),\n invoice_number character varying(256) NOT NULL,\n loan_id text -- reference to loans.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id)\n)\n\nCREATE TABLE finance.payments (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n processed_at timestamp without time zone,\n customer_id character varying(64) NOT NULL -- identifier for customer,\n payment_method text,\n delivery_status char NOT NULL,\n account_id text NOT NULL -- reference to accounts.invoice_id,\n FOREIGN KEY (account_id) REFERENCES accounts(invoice_id)\n)\n\nCREATE TABLE finance.customers (\n employee_id integer PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n last_active timestamp without time zone,\n avatar char NOT NULL,\n membership_level char,\n status character varying(256),\n last_name character varying(256) NOT NULL,\n email character varying(64),\n loan_id text NOT NULL -- reference to loans.invoice_id,\n FOREIGN KEY (loan_id) REFERENCES loans(invoice_id)\n)", "conversations": [{"role": "user", "content": "List all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments;", "sql": null}, {"role": "user", "content": "Order the output by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Order the output by account_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM finance.payments ORDER BY account_id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Get all metadata from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "What is the min trade_id for each card_type in metadata?", "sql": null}, {"role": "assistant", "content": "SELECT card_type, MIN(trade_id) AS min_trade_id FROM tradingplatform.metadata GROUP BY card_type;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the processed_at, status, delivery_status of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, delivery_status FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, status, delivery_status FROM tradingplatform.metadata WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Count the number of metadata in each card_type category.", "sql": null}, {"role": "assistant", "content": "SELECT card_type, COUNT(*) AS count FROM tradingplatform.metadata GROUP BY card_type ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Retrieve processed_at, card_type, delivery_status for every metadata.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, card_type, delivery_status FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata with dates from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, card_type, delivery_status FROM tradingplatform.metadata WHERE processed_at BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get average of status by trade_id from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, AVERAGE(status) AS average_status FROM tradingplatform.metadata GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Show me all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Sort the results by trade_id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY trade_id ASC;", "sql": null}, {"role": "user", "content": "Arrange the results with processed_at in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.metadata ORDER BY processed_at ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the status, card_type, delivery_status of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, delivery_status FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "List metadata with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, delivery_status FROM tradingplatform.metadata WHERE processed_at > '2023-12-01';", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT status, card_type, delivery_status FROM tradingplatform.metadata WHERE processed_at > '2023-12-01' ORDER BY delivery_status DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get currency, created_at, approval_status from all trades.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, approval_status FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "What approval_status, updated_at, status, processed_at do we have for trades and their associated metadata?", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, approval_status, metadata.status, metadata.processed_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.id;", "sql": null}, {"role": "user", "content": "Arrange the results with approval_status in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT currency, created_at, approval_status, metadata.status, metadata.processed_at FROM tradingplatform.trades JOIN tradingplatform.metadata ON trades.metadat_id = metadata.id ORDER BY approval_status ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Display all trades.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades;", "sql": null}, {"role": "user", "content": "Find trades where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Restrict the output to 20 items.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.trades WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the delivery_status, trade_id, card_type of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, trade_id, card_type FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Find metadata where delivery_status LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, trade_id, card_type FROM tradingplatform.metadata WHERE delivery_status LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate max of processed_at for each trade_id in metadata.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, MAX(processed_at) AS max_processed_at FROM tradingplatform.metadata GROUP BY trade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "What are the processed_at, delivery_status, card_type of each metadata?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, delivery_status, card_type FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "What card_type, processed_at, currency, updated_at do we have for metadata and their associated trades?", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, delivery_status, card_type, trades.currency, trades.updated_at FROM tradingplatform.metadata JOIN tradingplatform.trades ON metadata.trade_id = trades.transaction_id;", "sql": null}, {"role": "user", "content": "Get count of card_type by status from metadata.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(card_type) AS count_card_type FROM tradingplatform.metadata GROUP BY status;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.trades (\n transaction_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n created_at timestamp,\n buyer_id character varying(64),\n currency character varying(256) NOT NULL,\n user_id character varying(64),\n status character varying(256),\n approval_status character varying(256),\n metadat_id text NOT NULL -- reference to metadata.id,\n FOREIGN KEY (metadat_id) REFERENCES metadata(id)\n)\n\nCREATE TABLE tradingplatform.notifications (\n invoice_id varchar PRIMARY KEY -- unique identifier,\n due_date timestamp without time zone,\n created_at date,\n description character varying(128),\n vendor_id character varying(128) -- identifier for vendor,\n payee_id varchar -- identifier for payee,\n category character varying(256),\n payer_id char NOT NULL\n)\n\nCREATE TABLE tradingplatform.metadata (\n id varchar PRIMARY KEY -- unique identifier,\n processed_at date,\n card_type char NOT NULL,\n status varchar,\n delivery_status varchar,\n trade_id text NOT NULL -- reference to trades.transaction_id,\n FOREIGN KEY (trade_id) REFERENCES trades(transaction_id)\n)", "conversations": [{"role": "user", "content": "Get trade_id, status, card_type from all metadata.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, status, card_type FROM tradingplatform.metadata;", "sql": null}, {"role": "user", "content": "Show the results sorted by processed_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, status, card_type FROM tradingplatform.metadata ORDER BY processed_at ASC;", "sql": null}, {"role": "user", "content": "Show only 100 records.", "sql": null}, {"role": "assistant", "content": "SELECT trade_id, status, card_type FROM tradingplatform.metadata ORDER BY processed_at ASC LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "Get updated_at, grade_id, title from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, grade_id, title FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments with updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, grade_id, title FROM education.assignments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Only show the top 20 results.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, grade_id, title FROM education.assignments WHERE updated_at > '2023-01-01' LIMIT 20;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "List discount, updated_at, title from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT discount, updated_at, title FROM education.assignments;", "sql": null}, {"role": "user", "content": "Find assignments where updated_at > '2023-01-01'.", "sql": null}, {"role": "assistant", "content": "SELECT discount, updated_at, title FROM education.assignments WHERE updated_at > '2023-01-01';", "sql": null}, {"role": "user", "content": "Count the number of assignments in each updated_at category.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(*) AS count FROM education.assignments GROUP BY updated_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "List updated_at, discount, grade_id from assignments.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, discount, grade_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "Show me assignments that were older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, discount, grade_id FROM education.assignments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "What is the min discount for each grade_id in assignments?", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, MIN(discount) AS min_discount FROM education.assignments GROUP BY grade_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "Get image_url, title, grade_id from all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, title, grade_id FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments that have discount > 82.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, title, grade_id FROM education.assignments WHERE discount > 82;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT image_url, title, grade_id FROM education.assignments WHERE discount > 82 LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "List all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE updated_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "How many assignments are there per image_url?", "sql": null}, {"role": "assistant", "content": "SELECT image_url, COUNT(*) AS count FROM education.assignments GROUP BY image_url ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Order the output by updated_at ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY updated_at ASC;", "sql": null}, {"role": "user", "content": "Sort the results by country ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers ORDER BY country ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "Show me grade_id, title, updated_at for all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, title, updated_at FROM education.assignments;", "sql": null}, {"role": "user", "content": "Retrieve assignments where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT grade_id, title, updated_at FROM education.assignments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Show me the count of assignments grouped by title.", "sql": null}, {"role": "assistant", "content": "SELECT title, COUNT(*) AS count FROM education.assignments GROUP BY title ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "What are the last_inspected, grade_id, longitude of each teacher?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, grade_id, longitude FROM education.teachers;", "sql": null}, {"role": "user", "content": "Can you order these by timezone descending?", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, grade_id, longitude FROM education.teachers ORDER BY timezone DESC;", "sql": null}, {"role": "user", "content": "Only show the top 5 results.", "sql": null}, {"role": "assistant", "content": "SELECT last_inspected, grade_id, longitude FROM education.teachers ORDER BY timezone DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "Retrieve all assignments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments;", "sql": null}, {"role": "user", "content": "List assignments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.assignments WHERE updated_at >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Group assignments by updated_at and show the average of grade_id.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, AVERAGE(grade_id) AS average_grade_id FROM education.assignments GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE education.assignments (\n id varchar PRIMARY KEY -- unique identifier,\n updated_at timestamp,\n image_url character varying(256),\n title char,\n discount numeric,\n grade_id text -- reference to grades.order_id,\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.teachers (\n venue_id text PRIMARY KEY -- unique identifier,\n last_inspected date,\n updated_at timestamp,\n operating_hours char NOT NULL,\n timezone text,\n country character varying(128),\n longitude varchar NOT NULL,\n assignment_id text NOT NULL -- reference to assignments.id,\n grade_id text NOT NULL -- reference to grades.order_id,\n FOREIGN KEY (assignment_id) REFERENCES assignments(id),\n FOREIGN KEY (grade_id) REFERENCES grades(order_id)\n)\n\nCREATE TABLE education.grades (\n order_id text PRIMARY KEY -- unique identifier,\n completed_at timestamp,\n seller_id character varying(64) -- identifier for seller,\n approval_status text,\n exchange_rate character varying(256)\n)", "conversations": [{"role": "user", "content": "List all teachers.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers;", "sql": null}, {"role": "user", "content": "Retrieve teachers where the date is modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Sort the results by longitude descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM education.teachers WHERE last_inspected >= CURRENT_TIMESTAMP - INTERVAL '1 hour' ORDER BY longitude DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Show me all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by status ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY status ASC;", "sql": null}, {"role": "user", "content": "Calculate average of updated_at for each processed_at in orders.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, AVERAGE(updated_at) AS average_updated_at FROM tradingplatform.orders GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "List processed_at, tax, id from orders.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, tax, id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve orders where the date is from last week.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, tax, id FROM tradingplatform.orders WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different status values.", "sql": null}, {"role": "assistant", "content": "SELECT status, COUNT(*) AS count FROM tradingplatform.orders GROUP BY status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Order the output by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Limit the results to 50 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY delivery_status DESC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Show me processed_at, tax, wallet_id for all orders.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, tax, wallet_id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "List orders with dates older than 6 months.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, tax, wallet_id FROM tradingplatform.orders WHERE processed_at <= CURRENT_DATE - INTERVAL '6 months';", "sql": null}, {"role": "user", "content": "Tally up orders by processed_at.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(*) AS count FROM tradingplatform.orders GROUP BY processed_at ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Get updated_at, tax, id from all orders.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, tax, id FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get id, updated_at, exchange_rate, payer_id by joining orders with wallets.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, tax, id, wallets.exchange_rate, wallets.payer_id FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.id;", "sql": null}, {"role": "user", "content": "Group orders by fee and show the count of user_id.", "sql": null}, {"role": "assistant", "content": "SELECT fee, COUNT(user_id) AS count_user_id FROM tradingplatform.orders GROUP BY fee;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "What are the status, tax, delivery_status of each order?", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, delivery_status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Find orders from last week.", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, delivery_status FROM tradingplatform.orders WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT status, tax, delivery_status FROM tradingplatform.orders WHERE processed_at >= CURRENT_DATE - INTERVAL '7 days' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "What are the user_id, payment_method, status of each order?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, payment_method, status FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Get orders that match payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, payment_method, status FROM tradingplatform.orders WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Only show the top 100 results.", "sql": null}, {"role": "assistant", "content": "SELECT user_id, payment_method, status FROM tradingplatform.orders WHERE payment_method LIKE 'A%' LIMIT 100;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Retrieve status, id, due_date, updated_at showing the relationship between orders and wallets.", "sql": null}, {"role": "assistant", "content": "SELECT *, wallets.due_date, wallets.updated_at FROM tradingplatform.orders JOIN tradingplatform.wallets ON orders.wallet_id = wallets.id;", "sql": null}, {"role": "user", "content": "Get the distribution of orders across different delivery_status values.", "sql": null}, {"role": "assistant", "content": "SELECT delivery_status, COUNT(*) AS count FROM tradingplatform.orders GROUP BY delivery_status ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Retrieve all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Sort the results by delivery_status descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY delivery_status DESC;", "sql": null}, {"role": "user", "content": "Sort the results by id ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders ORDER BY id ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.orders (\n id character varying(64) NOT NULL -- unique identifier,\n processed_at timestamp,\n updated_at date,\n status character varying(64) NOT NULL,\n fee char NOT NULL,\n payment_method varchar,\n tax numeric NOT NULL,\n delivery_status character varying(128) NOT NULL,\n user_id character varying(256),\n wallet_id text -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)\n\nCREATE TABLE tradingplatform.users (\n customer_id integer PRIMARY KEY -- unique identifier,\n created_at timestamp,\n joined_at timestamp without time zone,\n token varchar,\n password_hash text NOT NULL,\n status character varying(128),\n username varchar NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n due_date date,\n updated_at timestamp,\n approval_status character varying(64),\n payer_id text,\n exchange_rate varchar\n)", "conversations": [{"role": "user", "content": "Get all orders.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders;", "sql": null}, {"role": "user", "content": "Show me orders that were between January and March.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31';", "sql": null}, {"role": "user", "content": "Sort the results by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.orders WHERE updated_at BETWEEN '2023-01-01' AND '2023-03-31' ORDER BY payment_method ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Get all payments.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments;", "sql": null}, {"role": "user", "content": "List payments with dates modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.payments WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "Get sum of payment_date by invoice_number from payments.", "sql": null}, {"role": "assistant", "content": "SELECT invoice_number, SUM(payment_date) AS sum_payment_date FROM banking.payments GROUP BY invoice_number;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Get booking_id, payment_date, created_at from all payments.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, payment_date, created_at FROM banking.payments;", "sql": null}, {"role": "user", "content": "Show me payments with description LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, payment_date, created_at FROM banking.payments WHERE description LIKE 'A%';", "sql": null}, {"role": "user", "content": "Show the results sorted by exchange_rate ascending.", "sql": null}, {"role": "assistant", "content": "SELECT booking_id, payment_date, created_at FROM banking.payments WHERE description LIKE 'A%' ORDER BY exchange_rate ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Show me processed_at, approval_status, tax for all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, approval_status, tax FROM banking.bookings;", "sql": null}, {"role": "user", "content": "Show me bookings with payment_method LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, approval_status, tax FROM banking.bookings WHERE payment_method LIKE 'A%';", "sql": null}, {"role": "user", "content": "Calculate count of product_id for each processed_at in bookings.", "sql": null}, {"role": "assistant", "content": "SELECT processed_at, COUNT(product_id) AS count_product_id FROM banking.bookings GROUP BY processed_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.students;", "sql": null}, {"role": "user", "content": "Get students that match api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.students WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "Get the distribution of students across different membership_level values.", "sql": null}, {"role": "assistant", "content": "SELECT membership_level, COUNT(*) AS count FROM banking.students GROUP BY membership_level ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Get all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.bookings;", "sql": null}, {"role": "user", "content": "Get status, student_id, last_name, gender by joining bookings with students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.last_name, students.gender FROM banking.bookings JOIN banking.students ON bookings.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Return just 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.last_name, students.gender FROM banking.bookings JOIN banking.students ON bookings.student_id = students.person_id LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Get all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.bookings;", "sql": null}, {"role": "user", "content": "Get payment_method, status, last_name, is_verified by joining bookings with students.", "sql": null}, {"role": "assistant", "content": "SELECT *, students.last_name, students.is_verified FROM banking.bookings JOIN banking.students ON bookings.student_id = students.person_id;", "sql": null}, {"role": "user", "content": "Get the distribution of bookings across different tax values.", "sql": null}, {"role": "assistant", "content": "SELECT tax, COUNT(*) AS count FROM banking.bookings GROUP BY tax ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve all bookings.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.bookings;", "sql": null}, {"role": "user", "content": "Can you order these by traded_at ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.bookings ORDER BY traded_at ASC;", "sql": null}, {"role": "user", "content": "Only show the top 50 results.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.bookings ORDER BY traded_at ASC LIMIT 50;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Display all students.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.students;", "sql": null}, {"role": "user", "content": "Get students that match api_key LIKE 'A%'.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.students WHERE api_key LIKE 'A%';", "sql": null}, {"role": "user", "content": "Sort the results by last_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM banking.students WHERE api_key LIKE 'A%' ORDER BY last_name DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE banking.payments (\n transaction_id text PRIMARY KEY -- unique identifier,\n created_at date,\n payment_date timestamp,\n invoice_number char,\n currency text,\n exchange_rate char,\n verification_status char,\n description char,\n booking_id text NOT NULL -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.students (\n person_id text PRIMARY KEY -- unique identifier,\n joined_at date,\n created_at timestamp,\n website character varying(64),\n is_verified boolean NOT NULL,\n gender char NOT NULL,\n membership_level character varying(256) NOT NULL,\n account_status character varying(128) NOT NULL,\n api_key char NOT NULL,\n last_name varchar NOT NULL,\n booking_id text -- reference to bookings.order_id,\n FOREIGN KEY (booking_id) REFERENCES bookings(order_id)\n)\n\nCREATE TABLE banking.bookings (\n order_id text PRIMARY KEY -- unique identifier,\n traded_at date,\n processed_at timestamp,\n approval_status character varying(256) NOT NULL,\n tax bigint NOT NULL,\n product_id character varying(256) NOT NULL -- identifier for product,\n payment_method character varying(64) NOT NULL,\n status varchar,\n student_id text -- reference to students.person_id,\n FOREIGN KEY (student_id) REFERENCES students(person_id)\n)", "conversations": [{"role": "user", "content": "Retrieve traded_at, processed_at, student_id for every booking.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, processed_at, student_id FROM banking.bookings;", "sql": null}, {"role": "user", "content": "Order the output by payment_method ascending.", "sql": null}, {"role": "assistant", "content": "SELECT traded_at, processed_at, student_id FROM banking.bookings ORDER BY payment_method ASC;", "sql": null}, {"role": "user", "content": "Show me average of status grouped by student_id for bookings.", "sql": null}, {"role": "assistant", "content": "SELECT student_id, AVERAGE(status) AS average_status FROM banking.bookings GROUP BY student_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Get all wallets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "List wallets with dates created after December 1st, 2023.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date > '2023-12-01';", "sql": null}, {"role": "user", "content": "Limit the results to 25 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.wallets WHERE payment_date > '2023-12-01' LIMIT 25;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Display all logs.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Sort the results by website descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.logs ORDER BY website DESC;", "sql": null}, {"role": "user", "content": "Show me count of password_hash grouped by updated_at for logs.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, COUNT(password_hash) AS count_password_hash FROM tradingplatform.logs GROUP BY updated_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Retrieve wallet_id, updated_at, website for every log.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, updated_at, website FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Show the results sorted by avatar ascending.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, updated_at, website FROM tradingplatform.logs ORDER BY avatar ASC;", "sql": null}, {"role": "user", "content": "Tally up logs by wallet_id.", "sql": null}, {"role": "assistant", "content": "SELECT wallet_id, COUNT(*) AS count FROM tradingplatform.logs GROUP BY wallet_id ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "List all users.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Sort the results by full_name descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY full_name DESC;", "sql": null}, {"role": "user", "content": "Return just 5 rows.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.users ORDER BY full_name DESC LIMIT 5;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "What are the balance, description, credit of each wallet?", "sql": null}, {"role": "assistant", "content": "SELECT balance, description, credit FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Order the output by payment_date descending.", "sql": null}, {"role": "assistant", "content": "SELECT balance, description, credit FROM tradingplatform.wallets ORDER BY payment_date DESC;", "sql": null}, {"role": "user", "content": "Arrange the results with description in ascending order.", "sql": null}, {"role": "assistant", "content": "SELECT balance, description, credit FROM tradingplatform.wallets ORDER BY description ASC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Get joined_at, city, first_name from all users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, first_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Show me users that were from 2023.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, city, first_name FROM tradingplatform.users WHERE last_active BETWEEN '2023-01-01' AND '2023-12-31';", "sql": null}, {"role": "user", "content": "Get sum of log_id by avatar from users.", "sql": null}, {"role": "assistant", "content": "SELECT avatar, SUM(log_id) AS sum_log_id FROM tradingplatform.users GROUP BY avatar;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "List verification_status, description, debit from wallets.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, description, debit FROM tradingplatform.wallets;", "sql": null}, {"role": "user", "content": "Find wallets modified within the last hour.", "sql": null}, {"role": "assistant", "content": "SELECT verification_status, description, debit FROM tradingplatform.wallets WHERE payment_date >= CURRENT_TIMESTAMP - INTERVAL '1 hour';", "sql": null}, {"role": "user", "content": "What is the sum invoice_number for each user_id in wallets?", "sql": null}, {"role": "assistant", "content": "SELECT user_id, SUM(invoice_number) AS sum_invoice_number FROM tradingplatform.wallets GROUP BY user_id;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Show me password_hash, avatar, updated_at for all logs.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, avatar, updated_at FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "Can you order these by wallet_id descending?", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, avatar, updated_at FROM tradingplatform.logs ORDER BY wallet_id DESC;", "sql": null}, {"role": "user", "content": "Tally up logs by password_hash.", "sql": null}, {"role": "assistant", "content": "SELECT password_hash, COUNT(*) AS count FROM tradingplatform.logs GROUP BY password_hash ORDER BY count DESC;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "Get last_active, joined_at, display_name from all users.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, display_name FROM tradingplatform.users;", "sql": null}, {"role": "user", "content": "Retrieve users where the date is created in the last 30 days.", "sql": null}, {"role": "assistant", "content": "SELECT last_active, joined_at, display_name FROM tradingplatform.users WHERE joined_at >= CURRENT_DATE - INTERVAL '30 days';", "sql": null}, {"role": "user", "content": "Show me max of avatar grouped by joined_at for users.", "sql": null}, {"role": "assistant", "content": "SELECT joined_at, MAX(avatar) AS max_avatar FROM tradingplatform.users GROUP BY joined_at;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.users (\n id varchar PRIMARY KEY -- unique identifier,\n joined_at date,\n last_active timestamp without time zone,\n full_name char,\n display_name character varying(256),\n avatar text,\n first_name char,\n city char,\n log_id text -- reference to logs.user_id,\n FOREIGN KEY (log_id) REFERENCES logs(user_id)\n)\n\nCREATE TABLE tradingplatform.wallets (\n id varchar PRIMARY KEY -- unique identifier,\n payment_date date,\n invoice_number char NOT NULL,\n description character varying(64) NOT NULL,\n balance bigint,\n credit character varying(128),\n verification_status char,\n amount bigint,\n debit varchar,\n user_id text -- reference to users.id,\n FOREIGN KEY (user_id) REFERENCES users(id)\n)\n\nCREATE TABLE tradingplatform.logs (\n user_id text PRIMARY KEY -- unique identifier,\n updated_at timestamp without time zone,\n website character varying(64),\n avatar varchar NOT NULL,\n password_hash character varying(128),\n wallet_id text NOT NULL -- reference to wallets.id,\n FOREIGN KEY (wallet_id) REFERENCES wallets(id)\n)", "conversations": [{"role": "user", "content": "What are the updated_at, website, password_hash of each log?", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, website, password_hash FROM tradingplatform.logs;", "sql": null}, {"role": "user", "content": "List website, updated_at, verification_status, invoice_number for each log along with their wallet information.", "sql": null}, {"role": "assistant", "content": "SELECT updated_at, website, password_hash, wallets.verification_status, wallets.invoice_number FROM tradingplatform.logs JOIN tradingplatform.wallets ON logs.wallet_id = wallets.id;", "sql": null}, {"role": "user", "content": "Show me sum of password_hash grouped by website for logs.", "sql": null}, {"role": "assistant", "content": "SELECT website, SUM(password_hash) AS sum_password_hash FROM tradingplatform.logs GROUP BY website;", "sql": null}]} {"system": "You are an expert in writing database language. You can write a corresponding database language query to answer the user's question based on the table structure described by the table creation statement.\n##Table Structure \nCREATE TABLE tradingplatform.assets (\n barcode varchar PRIMARY KEY -- unique identifier,\n published_at date,\n expires_at timestamp without time zone,\n description text NOT NULL,\n media_url character varying(64),\n image_url varchar NOT NULL,\n stock_level char NOT NULL,\n views varchar,\n featured_rank character varying(128),\n trade_id text NOT NULL -- reference to trades.id,\n FOREIGN KEY (trade_id) REFERENCES trades(id)\n)\n\nCREATE TABLE tradingplatform.trades (\n id text PRIMARY KEY -- unique identifier,\n created_at date,\n subtotal integer,\n product_id character varying(256) -- identifier for product,\n quantity varchar,\n user_id character varying(64) NOT NULL\n)\n\nCREATE TABLE tradingplatform.wallets (\n payment_id integer PRIMARY KEY -- unique identifier,\n payment_date date,\n updated_at timestamp without time zone,\n approval_status character varying(128),\n notes character varying(256),\n payee_id character varying(128) NOT NULL,\n asset_id text -- reference to assets.barcode,\n FOREIGN KEY (asset_id) REFERENCES assets(barcode)\n)", "conversations": [{"role": "user", "content": "Retrieve all assets.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets;", "sql": null}, {"role": "user", "content": "Can you order these by description ascending?", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY description ASC;", "sql": null}, {"role": "user", "content": "Sort the results by featured_rank descending.", "sql": null}, {"role": "assistant", "content": "SELECT * FROM tradingplatform.assets ORDER BY featured_rank DESC;", "sql": null}]}